Return results

Updated at:

Responses to API calls use a standard format. An HTTP status code in the 2xx range indicates a successful call. An HTTP status code in the 4xx or 5xx range indicates a failed call.

Successful responses can be in either XML or JSON format. You can specify the response format by passing a parameter in the request. The default format is XML.

The response examples in this document are formatted for readability. The actual response does not include line breaks or indents.

Successful results

XML example

<?xml version="1.0" encoding="UTF-8"?>
<!--Root node of the result-->
<APIName+Response>
    <!--Request ID tag-->
    <RequestId>4C467B38-3910-447D-87BC-AC049166F216</RequestId>
    <!--Response data-->
</APIName+Response>

JSON example

{
    "RequestId": "4C467B38-3910-447D-87BC-AC049166F216"
    /* Response data */
}

Error results

If an API call fails, no result data is returned. To determine the cause of the error, refer to the error code for the API and the error code table.

When a call fails, the request returns an HTTP status code in the 4xx or 5xx range. The response body contains the specific error code and error message. It also includes a globally unique request ID (RequestId) and the ID of the site that you accessed (HostId). If you cannot determine the cause of the error, contact Alibaba Cloud support. Provide the HostId and RequestId to help us resolve the issue.

XML example

<?xml version="1.0" encoding="UTF-8"?>
<Error>
   <RequestId>8906582E-6722-409A-A6C4-0E7863B733A5</RequestId>
   <HostId>httpdns-api.aliyuncs.com</HostId>
   <Code>DomainNotFound</Code>
   <Message>The domain is not found in this user's domain list.</Message>
</Error>

JSON example

{
    "RequestId": "8906582E-6722-409A-A6C4-0E7863B733A5",
    "HostId": "httpdns-api.aliyuncs.com",
    "Code": "DomainNotFound",
    "Message": "The domain is not found in this user's domain list."
}