Queries the status of a text message.

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 10080303003****

The ID of the text message.

Response parameters

Parameter Type Example Description
Status String 1

The status that indicates whether the text message was sent. Valid values:

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

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

ResponseCode String OK

The status that indicates whether the message sending 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 mobile phone number.

Carrier String CMI

The carrier that provides the mobile phone number.

Region String HongKong

The region to which the mobile phone number belongs.

Country String Hongkong, China

The country to which the mobile phone number belongs.

Message String Hello!

The content of the text message.

ResponseDescription String The SMS Send Request was accepted

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

ErrorCode String DELIVERED

The status code that indicates whether the text message was sent.

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

The time when the text message was sent to the carrier.

To String 6581****810

The mobile phone number that received the text message.

MessageId String 1008030****3003

The ID of the text message.

Examples

Sample requests

http(s)://dysmsapi.ap-southeast-1.aliyuncs.com/?Action=QueryMessage
&MessageId=10080303003****
&<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>
</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"
}

Error codes

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