Responses can be returned in the JSON or XML format. The default response format is XML. To change the format, you can configure the common parameter Format in requests. Sample responses in API Reference are formatted to improve readability. The actual responses may not be formatted by using line feeds or indentation.

Sample success responses

If a call is successful, the response contains response parameters and the corresponding request ID. The HTTP status code is 2xx.

  • JSON format
    {
        "TotalCount":25,
        "RequestId":"A66FCCB9-4538-193F-A67A-2E0A515A****",
        "PageSize":10,
        "PageNumber":1,
        "Regions":{
            "Region":[
                {
                    "RegionId":"cn-hangzhou",
                    "RegionEndpoint":"nas.cn-hangzhou.aliyuncs.com",
                    "LocalName":"China (Hangzhou)"
                },
                {
                    "RegionId":"cn-shanghai",
                    "RegionEndpoint":"nas.cn-shanghai.aliyuncs.com",
                    "LocalName":"China (Shanghai)"
                }
            ]
        }
    }
  • XML format
    <?xml version="1.0" encoding="UTF-8"?>
    <root>
      <TotalCount>25</TotalCount>
      <RequestId>A66FCCB9-4538-193F-A67A-2E0A515A****</RequestId>
      <PageSize>10</PageSize>
      <PageNumber>1</PageNumber>
      <Regions>
        <Region>
          <RegionId>cn-hangzhou</RegionId>
          <RegionEndpoint>nas.cn-hangzhou.aliyuncs.com</RegionEndpoint>
          <LocalName>China (Hangzhou)</LocalName>
        </Region>
        <Region>
          <RegionId>cn-shanghai</RegionId>
          <RegionEndpoint>nas.cn-shanghai.aliyuncs.com</RegionEndpoint>
          <LocalName>China (Shanghai)</LocalName>
        </Region>
      </Regions>
    </root>

Sample error responses

If an error occurs when you call an operation, an error response that consists of an error code, an error message, and a request ID is returned. The HTTP status code is 4xx or 5xx.

You can troubleshoot an error based on error codes that are specific to an API operation. For more information, see Error codes or visit the API Error Center.

If an error persists, contact NAS technical support and provide the endpoint (HostId) and request ID (RequestId).

  • JSON format
    {
      "RequestId": "98B65159-F38F-5F9E-AE07-4988FFC4****", /*The request ID.*/
      "HostId": "oos.cn-hangzhou.aliyuncs.com", /*The endpoint.*/
      "Code": "IllegalCharacters", /*The error code.*/
      "Message": "Parameter contains illegal characters.", /*The error message.*/
      "Recommend": "https://error-center.aliyun.com/status/search?Keyword=IllegalCharacters&source=PopGw" /*The URL of the API Error Center.*/
    }
  • XML format
    <?xml version="1.0" encoding="UTF-8"?><!--The root node of the response.-->
    <Error>
        <RequestId>98B65159-F38F-5F9E-AE07-4988FFC4****</RequestId> <!--The request ID.-->
        <HostId>nas.cn-hangzhou.aliyuncs.com</HostId> <!--The endpoint.-->
        <Code>IllegalCharacters</Code> <!--The error code.-->
        <Message>Parameter contains illegal characters.</Message> <!--The error message.-->
        <Recommend>https://error-center.aliyun.com/status/search?Keyword=IllegalCharacters&source=PopGw</Recommend><!--The URL of the API Error Center.-->
    </Error>