This topic describes the syntax of error responses in Message Service (MNS). If an error occurs when you access MNS, MNS returns HTTP status code 3xx, 4xx, or 5xx. MNS also returns a message body in the text or XML format.

Example of the message body in an error response:

    <? xml version="1.0"  encoding="UTF-8"? >
    <Error xmlns="http://mns.aliyuncs.com/doc/v1/">
        <Code>InvalidArgument</Code>
        <Message>Authorization header is invalid or missing. </Message>
        <RequestId>04bb60e3-28aa-4706-99b0-9345d834f266</RequestId>
        <HostId>mns.cn-hangzhou.aliyuncs.com</HostId>
    </Error>       

The message body of an error response includes the following parameters:

  • Code: the error code that MNS returns.
  • Message: the error message that MNS returns.
  • RequestId: the unique ID that is used to identify the request.

    If you submit a ticket for technical support, you must provide the request ID.

  • HostId: the endpoint that is used to access MNS. The endpoint varies based on different regions.

For more information about operation-specific errors, see the corresponding API operation.