edit-icon download-icon

Return results

Last Updated: Nov 28, 2017

After APIs are called, data is returned in the unified format. A returned HTTP status code of 2xx indicates that the call is successful. A returned HTTP status code of 4xx or 5xx indicates that the call fails. For successful calls, the primary formats of returned data are XML and JSON. When a request is sent, an external system can input parameters to specify the format of returned data. XML is the default format.

In this document, examples of results returned are formatted in a way that is easier for you to read. The actual results returned are not formatted with line breaks, indentation, or other layouts.

Successful results

XML return results include a message stating if the request is successful and the specific service data. An example is as follows:

  1. <?xml version="1.0" encoding="utf-8"?>
  2. <!—Result root node-->
  3. <API name+Response>
  4. <!—Return request tag-->
  5. <RequestId>4C4fdsf38-3910-447D-87AD-AC078932216</RequestId>
  6. <!—Return result data-->
  7. </API name+Response>

JSON example:

  1. {
  2. "RequestId": "4C4fdsf38-3910-447D-87AD-AC078932216",
  3. /* Return result data*/
  4. }

Error results

If an error is reported in an API call, no result data is returned. The caller can refer to the error code table in the appendix to locate the error cause. When an error occurs in a call, the HTTP request returns an HTTP status code of 4xx or 5xx. The returned message body contains the specific error code and error message. The message body also contains a globally unique RequestId and the HostId of the site you accessed with this request. If unable to locate the error cause, the caller can contact Alibaba Cloud customer service and provide the HostId and RequestId to help solve the problem as quickly as possible.

  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <Error>
  3. <RequestId>8906582E-6722-409A-A6C4-0E7863B733A5</RequestId>
  4. <HostId> r-kvstore.aliyuncs.com</HostId>
  5. <Code>UnsupportedOperation</Code>
  6. <Message>The specified action is not supported.</Message>
  7. </Error>

JSON example:

  1. {
  2. "RequestId": "7463B73D-35CC-4D19-A010-6B8D65D242EF",
  3. "HostId": " r-kvstore.aliyuncs.com",
  4. "Code": "UnsupportedOperation",
  5. "Message": "The specified action is not supported."
  6. }
Thank you! We've received your feedback.