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
For more information on the fundamental concepts and application of upload callbacks, see upload callback and Callback.
For more information on typical errors and how to troubleshoot them in upload callbacks, see upload callback errors and troubleshooting.
For more information on using Post Policy rules for server-side signing with different language SDKs, setting upload callbacks, and directly uploading data to OSS through forms, see the overview of server-side signature direct upload and upload callback setup.
For more information on configuring a direct upload service for mobile application data using OSS and setting up upload callbacks, see how to quickly establish a mobile application upload callback service.