Queries the status of a message.

QPS limit

You can call this operation up to 300 times per second. If the number of the calls per second exceeds the limit, throttling is triggered. As a result, your business may be affected. We recommend that you take note of the limit when you call this operation.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer. OpenAPI Explorer dynamically generates the sample code of the operation for different SDKs.

Request parameters

Parameter Type Required Example Description
Action String Yes QueryMessage

The operation that you want to perform. Set the value to QueryMessage.

MessageId String Yes 1008030xxx3003

The ID of the message.

Response parameters

Parameter Type Example Description
Status String 1

The status that indicates whether the message was sent.

  • 1: The message is sent.
  • 2: The message failed to be sent.
  • 3: The message is being sent.
ErrorDescription String success

The description of the status code that indicates whether the message was sent.

ResponseCode String OK

The status that indicates whether the delivery request was submitted.

ReceiveDate String Mon, 24 Dec 2018 16:58:22 +0800

The time when the delivery receipt was received from the carrier.

NumberDetail Object

The details about the recipient phone number.

Carrier String CMI

The carrier that provides the recipient phone number.

Region String HongKong

The region to which the recipient phone number belongs.

Country String Hongkong, China

The country to which the recipient phone number belongs.

Message String Hello!

The content of the message.

ResponseDescription String The SMS Send Request was accepted

The description of the status that indicates whether the delivery request was submitted.

ErrorCode String DELIVERED

The status code that indicates whether the message was sent.

SendDate String Mon, 24 Dec 2018 16:58:22 +0800

The time when the message was sent to the carrier.

To String 6581xxx810

The mobile phone number of the recipient.

MessageId String 1008030xxx3003

The ID of the message.

RequestId String F655A8D5-B967-440B-8683-DAD6FF8D28D0

The ID of the request.

Examples

Sample requests

http(s)://dysmsapi.ap-southeast-1.aliyuncs.com/?Action=QueryMessage
&MessageId=1008030xxx3003
&<Common request parameters>

Sample success responses

XML format

HTTP/1.1 200 OK
Content-Type:application/xml

<QueryMessageResponse>
    <Status>1</Status>
    <ErrorDescription>success</ErrorDescription>
    <ResponseCode>OK</ResponseCode>
    <ReceiveDate>Mon, 24 Dec 2018 16:58:22 +0800</ReceiveDate>
    <NumberDetail>
        <Carrier>CMI</Carrier>
        <Region>HongKong</Region>
        <Country>Hongkong, China</Country>
    </NumberDetail>
    <Message>Hello!</Message>
    <ResponseDescription>The SMS Send Request was accepted</ResponseDescription>
    <ErrorCode>DELIVERED</ErrorCode>
    <SendDate>Mon, 24 Dec 2018 16:58:22 +0800</SendDate>
    <To>6581xxx810</To>
    <MessageId>1008030xxx3003</MessageId>
    <RequestId>F655A8D5-B967-440B-8683-DAD6FF8D28D0</RequestId>
</QueryMessageResponse>

JSON format

HTTP/1.1 200 OK
Content-Type:application/json

{
  "Status" : "1",
  "ErrorDescription" : "success",
  "ResponseCode" : "OK",
  "ReceiveDate" : "Mon, 24 Dec 2018 16:58:22 +0800",
  "NumberDetail" : {
    "Carrier" : "CMI",
    "Region" : "HongKong",
    "Country" : "Hongkong, China"
  },
  "Message" : "Hello!",
  "ResponseDescription" : "The SMS Send Request was accepted",
  "ErrorCode" : "DELIVERED",
  "SendDate" : "Mon, 24 Dec 2018 16:58:22 +0800",
  "To" : "6581xxx810",
  "MessageId" : "1008030xxx3003",
  "RequestId" : "F655A8D5-B967-440B-8683-DAD6FF8D28D0"
}

Error codes

For a list of error codes, visit the API Error Center.