Responses are returned in the JSON or XML format. The default response format is XML.
To change the format, you can set the Format
parameter in requests. Sample responses provided in API reference are formatted with
line breaks and indentations for better readability and clarity. However, the actual
responses are not formatted with line breaks or indentations.
Sample success responses
After an API operation is successfully called, success responses including response parameters and the request ID are returned. The HTTP status code is 2xx.
- XML format
<? xml version="1.0" encoding="UTF-8"? > <! --Result Root Node--> <ActionResponse> <! --Return Request Tag--> <RequestId>4C467B38-3910-447D-87BC-AC049166F216</RequestId> <! --Return Result Data--> </ActionResponse>
- JSON format
{ "RequestId": "4C467B38-3910-447D-87BC-AC049166F216" /* Response data */ }
Sample error response
If an API call fails, error responses including error codes, error messages, and the request ID are returned. The HTTP status code is 4xx or 5xx.
For a list of error codes,visit the VPC API error center.
- XML format
<? xml version="1.0" encoding="UTF-8"? ><! --Result Root Node--> <Error> <RequestId>540CFF28-407A-40B5-B6A5-74Bxxxxxxxxx</RequestId> <! --Request ID--> <HostId>vpc.aliyuncs.com</HostId> <! -- Endpoint--> <Code>MissingParameter.CommandId</Code> <! -- Error code --> <Message>The input parameter "CommandId" that is mandatory for processing this request is not supplied. </Message> <! -- Error message --> </Error>
- JSON format
{ "RequestId": "540CFF28-407A-40B5-B6A5-74Bxxxxxxxxx", /* Request ID */ "HostId": "vpc.aliyuncs.com",/* Service endpoint */ "Code": "MissingParameter.CommandId",/* Error code */ "Message": "The input parameter "CommandId" that is mandatory for processing this request is not supplied." /* Error message */ }