QuerySendDetails

Updated at:

Queries the SMS sending records and sending status of a single phone number.

Operation description

  • This operation queries the details of SMS messages sent to a specific phone number on a specified date. You can also specify the sending serial number (BizId) to query a specific sending record for the phone number.

  • This operation only supports querying the sending details of a single phone number. To view the sending details of SMS messages in batches, call the QuerySendStatistics operation to query the statistical details of SMS sending, or log on to the Sending Record Query page in the console.

QPS limit

The QPS limit for a single user is 5,000 requests per second. If the limit is exceeded, API calls are throttled. Use the API properly.

Try it now

Try this API in OpenAPI Explorer, no manual signing needed. Successful calls auto-generate SDK code matching your parameters. Download it with built-in credential security for local usage.

Test

RAM authorization

The table below describes the authorization required to call this API. You can define it in a Resource Access Management (RAM) policy. The table's columns are detailed below:

  • Action: The actions can be used in the Action element of RAM permission policy statements to grant permissions to perform the operation.

  • API: The API that you can call to perform the action.

  • Access level: The predefined level of access granted for each API. Valid values: create, list, get, update, and delete.

  • Resource type: The type of the resource that supports authorization to perform the action. It indicates if the action supports resource-level permission. The specified resource must be compatible with the action. Otherwise, the policy will be ineffective.

    • For APIs with resource-level permissions, required resource types are marked with an asterisk (*). Specify the corresponding Alibaba Cloud Resource Name (ARN) in the Resource element of the policy.

    • For APIs without resource-level permissions, it is shown as All Resources. Use an asterisk (*) in the Resource element of the policy.

  • Condition key: The condition keys defined by the service. The key allows for granular control, applying to either actions alone or actions associated with specific resources. In addition to service-specific condition keys, Alibaba Cloud provides a set of common condition keys applicable across all RAM-supported services.

  • Dependent action: The dependent actions required to run the action. To complete the action, the RAM user or the RAM role must have the permissions to perform all dependent actions.

Action

Access level

Resource type

Condition key

Dependent action

dysms:QuerySendDetails

get

*All Resource

*

None None

Request parameters

Parameter

Type

Required

Description

Example

PhoneNumber

string

Yes

The phone number to be queried. Format:

  • Domestic SMS: an 11-digit phone number, such as 1390000****.

  • International or Hong Kong, Macao, and Taiwan SMS: country code + phone number, such as 8520000****.

Note

You can specify only one phone number.

1390000****

BizId

string

No

The ID of the sending receipt, which is the sending serial number. This is the BizId field in the response when you call the SendSms or SendBatchSms operation to send an SMS message.

Note

You can specify only one BizId value.

134523^435****

SendDate

string

Yes

The date when the SMS message was sent. You can query records from the last 30 days.

Format: yyyyMMdd, such as 20250601.

20250601

PageSize

integer

Yes

The number of SMS records to return on each page.

Valid values: 1 to 50.

20

CurrentPage

integer

Yes

The current page number of the sending records.

1

You can visit the OpenAPI portal to view the request examples for SDKs in various languages.

Response elements

Element

Type

Description

Example

object

Code

string

The request status code.

  • A value of OK indicates that the request was successful.

  • For other error codes, see Error codes.

OK

Message

string

The description of the status code.

OK

RequestId

string

The ID of the request. It is a unique identifier generated by Alibaba Cloud for the request and can be used to troubleshoot issues.

819BE656-D2E0-4858-8B21-B2E477085AAF

TotalCount

string

The total number of SMS messages sent.

Note
  • This value indicates the number of submissions, not the number of billable messages.

1

SmsSendDetailDTOs

object

SmsSendDetailDTO

array<object>

The SMS sending details.

object

ErrCode

string

The SMS status code returned by the carrier.

  • If the SMS message was sent successfully, the value is DELIVERED.

  • If the SMS message failed to be sent, see Error codes for the error code.

DELIVERED

TemplateCode

string

The code of the SMS template.

Note

If you use the [Test Only] Alibaba Cloud Communications signature and the [Test Only] Alibaba Cloud Communications Test Template template to send test SMS messages, this operation does not return the TemplateCode field.

SMS_12231****

OutId

string

The extended field for the external serial number.

Note

If the OutId parameter is not specified when the SMS message is sent, this operation does not return the OutId field.

123

ReceiveDate

string

The date and time when the SMS message was received.

2025-06-01 16:44:13

SendDate

string

The date and time when the SMS message was sent.

2025-06-01 16:44:10

PhoneNum

string

The phone number that received the SMS message.

1390000****

Content

string

The content of the SMS message.

[Alibaba Cloud] Your verification code is 123. You are logging on. If you did not perform this operation, do not disclose the code

SendStatus

integer

The sending status of the SMS message. Valid values:

  • 1: Waiting for receipt.

  • 2: Sending failed.

  • 3: Sending succeeded.

3

SkuCode

string

The specification code of the SMS service.

ServiceItemStatus

string

The status of the SMS service item.

Examples

Success response

JSON format

{
  "Code": "OK",
  "Message": "OK",
  "RequestId": "819BE656-D2E0-4858-8B21-B2E477085AAF",
  "TotalCount": "1",
  "SmsSendDetailDTOs": {
    "SmsSendDetailDTO": [
      {
        "ErrCode": "DELIVERED",
        "TemplateCode": "SMS_12231****",
        "OutId": "123",
        "ReceiveDate": "2025-06-01 16:44:13",
        "SendDate": "2025-06-01 16:44:10",
        "PhoneNum": "1390000****",
        "Content": "【Alibaba Cloud】Your verification code is 123. You are logging in. Do not share this code with anyone",
        "SendStatus": 3,
        "SkuCode": "",
        "ServiceItemStatus": ""
      }
    ]
  }
}

Error codes

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.