By configuring a message queue or an HTTP URL, you can receive delivery receipts after you send your messages. This enables you to monitor the delivery status of your messages and deploy your services accordingly, ensuring optimal performance and user experience.
If a network error occurs or the response times out during message delivery, delivery receipts may be repeatedly pushed or fail to be received.
It may take some time for the message delivery configuration to take effect. We recommend that you wait for 3 minutes and check whether the delivery receipts are pushed.
The idempotence of delivery receipts cannot be guaranteed. We recommend that you take appropriate measures to ensure the correctness and consistency of your data after receiving a delivery receipt.
Delivery receipts endpoint
You can configure an MNS queue or HTTP URL to receive receipt messages or MO messages based on your needs.
Message queues
You can configure a message queue to receive delivery receipts from a specified region. MNS queues support all message types of Alibaba Cloud Short Message Service (SMS). After you enable MNS to subscribe to a specified message type in the SMS console, MNS automatically generates a queue. You can call SMS SDKs to pull delivery receipts by message type and queue name.
HTTP URLs
You can set up an HTTP URL to receive delivery receipts or MO messages for SMS. To achieve this, SMS utilizes the HTTP POST method to push delivery receipts or MO messages to the specified HTTP URL. You can configure the HTTP callback URL in the SMS console. When a service message is generated, the system sends an HTTP POST request containing the delivery receipt to the designated callback URL. This allows you to receive the message directly.
Types of delivery receipts
You need to select the types of delivery receipts that you want to receive. Different types of delivery receipts are used in different scenarios. The following table lists the types of delivery receipts.
Type | Description | MNS queue | HTTP URL |
MT delivery report (SmsReport) | A mobile terminated (MT) delivery report is a message (such as a notification or business message) that is sent from SMS carriers to customers. MT delivery reports indicate the delivery status and details of each message. |
Configure delivery receipts
To receive delivery receipts for your SMS messages, you need to configure the delivery receipt settings in the SMS console. Perform the following operations to configure the settings:
Log on to the SMS console.
In the left-side navigation pane, choose
.On the General Settings page, click the API tab.
In the SMS Delivery Report Setting section, configure one or more endpoints for delivery receipts.
MNS queues
Enable the Message queues option.
HTTP URLs
Enable the HTTP URLs option.
Enter an HTTP URL. Example: http://push.example.com/contextpath/receive.do.
Click Save.
Request parameters of MNS queues
Parameter | Type | Required | Example | Description |
MessageType | String | Yes | SmsReport | The type of the message. Set the value to SmsReport. |
QueueName | String | Yes | Alicom-Queue-*****-SmsReport | The name of the queue. To view the name of the queue, log on to the SMS console, and then choose in the left-side navigation pane. |