故障图片上传获取签名信息

调试

您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。

请求头

该接口使用公共请求头,无特殊请求头。请参见公共请求参数文档。

请求语法

POST /problem/process/oss/generatePostPolicy HTTP/1.1

请求参数

名称 类型 位置 是否必选 示例值 描述
Object Body

A short description of struct

fileName String Body test

文件名

fileType String Body png

文件类型

fileSize Long Body 1000

文件大小KB

problemId Long Body 67876

故障id

返回数据

名称 类型 示例值 描述
requestId String e2d4306a-bf4d-4345-9ae6-158223c85dbd

requestId

data Object

data

bucketName String xxxx-xxxx-xxxx

oss bucket name

key String problem/xxxxxxxxxxxxxxxx1-b3185d529277

oss key

policy String eyJleHBpcmF0a0p0IjoiMjAyMS0wNy0xM1QwNDowOTo0NS4yODJaIiwiY29uZGl0aW9ucyI6W1siY29udGVudC1sZW5ndGgtcmFuZ2UiLDAsMTA0ODU3NjAwXSxbInN0YXJ0cy13aXRoIiwiJGtleSIsInByb2JsZW0iXV19

policy

signature String SHqvIkwUNQd0o0rvklir2K8U+ts=

signature

url String https://xxx-xxx-bucket.oss-cn-shanghai.aliyuncs.com

url

accessKeyId String XXXXXXXH8GMy1iLRCno7

ossaccessKeyId

示例

请求示例

POST /problem/process/oss/generatePostPolicy HTTP/1.1
Host:gemp.cn-shanghai.aliyuncs.com
Content-Type:application/json

{
  "fileName" : "test",
  "fileType" : "png",
  "fileSize" : 1000,
  "problemId" : 67876
}

正常返回示例

XML格式

HTTP/1.1 200 OK
Content-Type:application/xml

<GenerateProblemPictureUploadSignResponse>
    <requestId>e2d4306a-bf4d-4345-9ae6-158223c85dbd</requestId>
    <data>
        <bucketName>xxxx-xxxx-xxxx</bucketName>
        <key>problem/xxxxxxxxxxxxxxxx1-b3185d529277</key>
        <policy>eyJleHBpcmF0a0p0IjoiMjAyMS0wNy0xM1QwNDowOTo0NS4yODJaIiwiY29uZGl0aW9ucyI6W1siY29udGVudC1sZW5ndGgtcmFuZ2UiLDAsMTA0ODU3NjAwXSxbInN0YXJ0cy13aXRoIiwiJGtleSIsInByb2JsZW0iXV19</policy>
        <signature>SHqvIkwUNQd0o0rvklir2K8U+ts=</signature>
        <url>https://xxx-xxx-bucket.oss-cn-shanghai.aliyuncs.com</url>
        <accessKeyId>XXXXXXXH8GMy1iLRCno7</accessKeyId>
    </data>
</GenerateProblemPictureUploadSignResponse>

JSON格式

HTTP/1.1 200 OK
Content-Type:application/json

{
  "requestId" : "e2d4306a-bf4d-4345-9ae6-158223c85dbd",
  "data" : {
    "bucketName" : "xxxx-xxxx-xxxx",
    "key" : "problem/xxxxxxxxxxxxxxxx1-b3185d529277",
    "policy" : "eyJleHBpcmF0a0p0IjoiMjAyMS0wNy0xM1QwNDowOTo0NS4yODJaIiwiY29uZGl0aW9ucyI6W1siY29udGVudC1sZW5ndGgtcmFuZ2UiLDAsMTA0ODU3NjAwXSxbInN0YXJ0cy13aXRoIiwiJGtleSIsInByb2JsZW0iXV19",
    "signature" : "SHqvIkwUNQd0o0rvklir2K8U+ts=",
    "url" : "https://xxx-xxx-bucket.oss-cn-shanghai.aliyuncs.com",
    "accessKeyId" : "XXXXXXXH8GMy1iLRCno7"
  }
}

错误码

访问错误中心查看更多错误码。

访问错误中心查看更多错误码。