Release Notes
Announcements
Variable Name | Variable Description | Whether Sub-Variables Are Included | Required or Not |
bucket | The target bucket for object upload. | No | No |
object | The object name used for uploading the object to the bucket. | No | No |
size | Object size, in bytes. | No | No |
region | The region of the bucket for object upload. | No | No |
mimeType | Object metadata Content-Type. | No | No |
exif | If the uploaded object is an image type, it supports viewing the image's exif information, and the variable format is ${exif.sub-variable}.Note: To avoid ReturnBody carrying too much content and affecting interface performance, it is not recommended to directly fill in ${exif}; it is advised to specify the specific sub-variables. | Yes | No |
videoInfo | If the uploaded object is an audio or video type, it supports viewing the metadata of the audio and video resources. The variable format is ${videoInfo.sub-variable}.Note: To avoid ReturnBody carrying too much content and affecting interface performance, it is not recommended to directly fill in ${videoInfo}; it is advised to specify the specific sub-information items. | Yes | No |
imageInfo | If the uploaded object is an image type, it supports viewing the basic information of the image. The variable format is ${imageInfo.sub-variable}.Note: To avoid ReturnBody carrying excessive content and affecting interface performance, it is not recommended to directly fill in ${imageInfo}; it is advised to specify the specific sub-variables. | Yes | No |
${variableName.sub-variable} and ${variableName.second-level-sub-variable}. To avoid ReturnBody carrying excessive content and affecting interface performance, it is not recommended to directly fill in ${imageInfo}; it is advised to specify the specific sub-variables.${}, and the values corresponding to these variable names represent the callback information to be obtained. For supported variable names in ReturnBody, refer to System Variables above. Sample:# Example of Obtaining Image Information{"bucket": "${bucket}","key": "${object}","myfilesize": "${size}","height": "${imageInfo.height}"}# Sample for Obtaining Video Information Refer to the response content when magicvar = 1 in Obtain media information{"bucket":"${bucket}","key":"${object}","myfilesize":"${size}","video_duration":"${videoInfo.format.duration}","video_bitrate":"${videoInfo.format.bit_rate}"}
# Example of Obtaining Image InformationeyJidWNrZXQiOiAiJHtidWNrZXR9IiwgImtleSI6ICIke29iamVjdH0iLCAibXlmaWxlc2l6ZSI6ICIke3NpemV9IiwgImhlaWdodCI6ICIke2ltYWdlSW5mby5oZWlnaHR9In0=# Example of Obtaining Video InformationewogICAgImJ1Y2tldCI6ICIke2J1Y2tldH0iLAogICAgImtleSI6ICIke29iamVjdH0iLAogICAgIm15ZmlsZXNpemUiOiAiJHtzaXplfSIsCiAgICAidmlkZW9fZHVyYXRpb24iOiAiJHt2aWRlb0luZm8uZm9ybWF0LmR1cmF0aW9ufSIsCiAgICAidmlkZW9fYml0cmF0ZSI6ICIke3ZpZGVvSW5mby5mb3JtYXQuYml0X3JhdGV9Igp9
x-cos-return-body. The request example is as follows:PUT /<ObjectKey> HTTP/1.1Host: <BucketName-APPID>.cos.<Region>.myqcloud.comDate: GMT DateContent-Type: Content TypeContent-Length: Content LengthContent-MD5: MD5x-cos-return-body: eyJidWNrZXQiOiAiJHtidWNrZXR9IiwgImtleSI6ICIke29iamVjdH0iLCAibXlmaWxlc2l6ZSI6ICIke3NpemV9IiwgImhlaWdodCI6ICIke2ltYWdlSW5mby5oZWlnaHR9In0=Authorization: Auth String[Object Content]
x-cos-return-body.POST / HTTP/1.1Host: examplebucket-1250000000.cos.ap-beijing.myqcloud.comDate: Thu, 29 Aug 2019 07:39:34 GMTContent-Type: multipart/form-data; boundary=----WebKitFormBoundaryZBPbaoYE2gqeB21NContent-Length: 1119Connection: close------WebKitFormBoundaryZBPbaoYE2gqeB21NContent-Disposition: form-data; name="q-sign-algorithm"sha1------WebKitFormBoundaryZBPbaoYE2gqeB21NContent-Disposition: form-data; name="q-ak"AKIDLdDGwRp0KIuI9sZDeJG3xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx------WebKitFormBoundaryZBPbaoYE2gqeB21NContent-Disposition: form-data; name="q-key-time"1759216346;1759217246------WebKitFormBoundaryZBPbaoYE2gqeB21NContent-Disposition: form-data; name="q-signature"71f6d4a559axxxxxxxxxxxxxxxxxxxxxxxxx------WebKitFormBoundaryZBPbaoYE2gqeB21NContent-Disposition: form-data; name="policy"eyJleHBpcmF0aW9uIjoiMjAyNS0wOS0zMFQwNzoyNzoyNi4wMDBaIiwiY29uZGl0aW9ucyI6W3sicS1zaWduLWFsZ29yaXRobSI6InNoYTEifSx7InEtYWsiOiJBS0lETGRER3dScDBLSXVJOXNaRGVKRzN4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHgifSx7InEtc2lnbi10aW1lIjoiMTc1OTIxNjM0NjsxNzU5MjE3MjQ2In0seyJidWNrZXQiOiJleGFtcGxlYnVja2V0LTEyNTAwMDAwMDAifSx7ImtleSI6ImV4YW1wbGVvYmplY3QifV19------WebKitFormBoundaryZBPbaoYE2gqeB21NContent-Disposition: form-data; name="x-cos-security-token"ZflOqzkNb2266djz4xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx------WebKitFormBoundaryZBPbaoYE2gqeB21NContent-Disposition: form-data; name="key"exampleobject------WebKitFormBoundaryZBPbaoYE2gqeB21NContent-Disposition: form-data; name="x-cos-return-body"ewogICAgImJ1Y2tldCI6ICIke2J1Y2tldH0iLAogICAgImtleSI6ICIke29iamVjdH0iLAogICAgIm15ZmlsZXNpemUiOiAiJHtzaXplfSIsCiAgICAidmlkZW9fZHVyYXRpb24iOiAiJHt2aWRlb0luZm8uZm9ybWF0LmR1cmF0aW9ufSIsCiAgICAidmlkZW9fYml0cmF0ZSI6ICIke3ZpZGVvSW5mby5mb3JtYXQuYml0X3JhdGV9Igp9------WebKitFormBoundaryZBPbaoYE2gqeB21NContent-Disposition: form-data; name="file"; filename="example.mp4"Content-Type: video/mp4[Object Content]------WebKitFormBoundaryZBPbaoYE2gqeB21N--
POST /exampleobject?uploadId=UploadId HTTP/1.1Host: exmaplebucket-1250000000.cos.region.myqcloud.comx-cos-return-body: ewogICAgImJ1Y2tldCI6ICIke2J1Y2tldH0iLAogICAgImtleSI6ICIke29iamVjdH0iLAogICAgIm15ZmlsZXNpemUiOiAiJHtzaXplfSIsCiAgICAidmlkZW9fZHVyYXRpb24iOiAiJHt2aWRlb0luZm8uZm9ybWF0LmR1cmF0aW9ufSIsCiAgICAidmlkZW9fYml0cmF0ZSI6ICIke3ZpZGVvSW5mby5mb3JtYXQuYml0X3JhdGV9Igp9Date: GMT DateContent-Type: application/xmlContent-Length: Content LengthContent-MD5: MD5Authorization: Auth String[Request Body]
HTTP/1.1 200 OKx-cos-request-id: NWU5MDNkZjVfYzVjNzJhMDlfMjVhNzNfMWMy****{"bucket": "examplebucket-1250000000000","height": "887","key": "test.jpeg","myfilesize": "214513"}
HTTP/1.1 201 OKx-cos-request-id: NWU5MDNkZjVfYzVjNzJhMDlfMjVhNzNfMWMy****{"bucket": "examplebucket-1250000000000","key": "test.mp4","myfilesize": "214513","video_duration": 1000,"video_bitrate": 1000}
Node Name (Keyword) | Parent Node | Description | Type |
ReturnBodyResult | CompleteMultipartUploadResult | ReturnBody's result information. | Container |
Status | CompleteMultipartUploadResult.ReturnBodyResult | Whether the ReturnBody is obtained successfully. Supported enum values: 200, 203. 200 indicates a successful upload and successful obtainment of ReturnBody; 203 indicates a successful upload but failure to obtain ReturnBody. | Integer |
Error | CompleteMultipartUploadResult.ReturnBodyResult | When the Status is 203, it indicates that the ReturnBody failed to be obtained. An Error is returned, providing the callback failure information. | Container |
Code | CompleteMultipartUploadResult.ReturnBodyResult | The error code for callback failure information, such as GetReturnBodyFailed. | String |
Message | CompleteMultipartUploadResult.ReturnBodyResult | The error message for a failed obtainment of ReturnBody. | String |
ReturnBody | CompleteMultipartUploadResult.ReturnBodyResult | When the Status is 200, it indicates a successful upload and callback. The ReturnBody is returned, which is a Base64-encoded string of the ReturnBody json. | String |
HTTP/1.1 200 OKContent-Type: application/xml<CompleteMultipartUploadResult><Location>http://examplebucket-1250000000.cos.ap-beijing.myqcloud.com/exampleobject</Location><Bucket>examplebucket-1250000000</Bucket><Key>exampleobject</Key><ETag>"aa259a62513358f69e98e******"</ETag><ReturnBodyResult><Status>200|203</Status><!--When the Status is 203, it indicates that ReturnBody failed, and an Error is returned--><Error><Code>GetReturnBodyFailed</Code><Message>Invalid return body params.</Message></Error><!--When the Status is 200, it indicates a successful upload and successful computation of ReturnBody. The Base64-encoded result of the json string is returned.--><ReturnBody>eyJhIjogImIifQ==</ReturnBody></ReturnBodyResult></CompleteMultipartUploadResult>
Failure reason | Return code | ErrorCode | Message |
The ReturnBody parameter is invalid. | 203 | GetReturnBodyFailed | Invalid return body params. |
Calling the CI service results in a failure to obtain parameters due to reasons such as lack of access permissions or unactivated services. | 203 | GetReturnBodyFailed | Error status from ci: ${code}, should return 200 OK. Here, ${code} is the error code returned by the data service, such as 400, 403, etc. |
Was this page helpful?
You can also Contact sales or Submit a Ticket for help.
Help us improve! Rate your documentation experience in 5 mins.
Feedback