After the API service is called, the returned data is in a unified format.
The returned HTTP status code 2xx indicates that the call is successful.
The returned HTTP status code 4xx or 5xx indicates that the call failed.
The formats of returned data from successful calls are mainly XML and JSON. An external system can pass in parameters during requesting to specify the format of the returned data. XML is the default format.
The formats in the examples in this document are adjusted for viewing convenience. The actual returned results have no line breaks, indentation, or other layouts.
Successful results
XML example
<?xml version="1.0" encoding="UTF-8"?>
<!--Result root node-->
<Interface name + Response>
<!--Return request tag-->
<RequestId>4C467B38-3910-447D-87BC-AC049166F216</RequestId>
<!--Return result data-->
</Interface name + Response>
JSON example
{
"RequestId": "4C467B38-3910-447D-87BC-AC049166F216"
/* Return result data*/
}
Error results
When an error occurs in an interface call, no result data returns. You can pinpoint the causes of the error based on the error codes corresponding to each interface and the public error codes that are listed in Error codes.
When an error occurs in a call, an HTTP status code of 4xx or 5xx will be returned. The returned message body contains the specific error code and error message. The message body also contains a globally unique RequestId and the requested HostId. If you cannot find the error cause, you can contact Alibaba Cloud customer service and provide the HostId and RequestId to help us solve the problem as quickly as possible.
XML example
<?xml version="1.0" encoding="UTF-8"?>
<Error>
<RequestId>8906582E-6722-409A-A6C4-0E7863B733A5</RequestId>
<HostId>dm.aliyuncs.com</HostId>
<Code>InvalidTemplate.NotFound</Code>
<Message>The specified template is not found.</Message>
</Error>
JSON example
{
"RequestId": "8906582E-6722-409A-A6C4-0E7863B733A5",
"HostId": "dm.aliyuncs.com",
"Code": "InvalidTemplate.NotFound",
"Message": "The specified template does not found."
}