All Products
Search
Document Center

Object Storage Service:0007-00000011

Last Updated:Feb 28, 2025

Problem description

The callbackBody part in the Callback parameter of the upload callback request is empty.

Cause of the problem

When Base64 decoded, the Callback parameter for the upload callback in your request reveals a JSON structure. The callbackBody must contain a string with the request body parameters for the callback. An empty string in this field will lead to an interface error.

The callbackBody parameter represents the request body's value when initiating a callback, such as key=${object}&etag=${etag}&my_var=${x:my_var}. It must not be an empty string.

Problem example

For instance, the decoded callback parameter in your request is:

{
	"callbackUrl":"www.oss-callback.com/test.php",
	"callbackBody":""
}

Here, the callbackBody parameter is an empty string instead of the required string containing request parameters, causing the interface to return this error.

Solutions

Ensure that the callbackBody value is a string that meets the callbackBodyType requirements.

  • If the callbackBodyType is application/x-www-form-urlencoded, the format should be as follows:

{
  "callbackUrl": "www.oss-callback.com/test.php",
  "callbackBody": "bucket=${bucket}&object=${object}&etag=${etag}&size=${size}&mimeType=${mimeType}&imageInfo.height=${imageInfo.height}&imageInfo.width=${imageInfo.width}&imageInfo.format=${imageInfo.format}&my_var=${x:my_var}",
  "callbackBodyType": "application/x-www-form-urlencoded"
}
  • If the callbackBodyType is application/json, the format should be as follows:

{
  "callbackUrl": "www.oss-callback.com/test.php",
  "callbackBody": "{\"mimeType\":${mimeType},\"size\":${size}}",
  "callbackBodyType": "application/json"
}

References