Webhook Report-SMS-deliver-status
Push SMS deliver status notification to your API address
Webhook
Notification HTTP Method
POST
Notification Content-Type
application/json
Sample Notification Body
Example of notification body:
{
"report": [
{
"trade_id": "7093878ea7854d8be4ec5f051bff****", // trade_id in Send-SMS API response
"send_time": 1679389333, // sms send timestamp
"recv_time": 1679389339, // sms receive timestamp
"deliver_status": "DELIVRD", // sms deliver status, "DELIVRD" means that the message delivered to the user, and others are the reasons for not delivered
"phone": "+85264****92" // phone number
}
], // deliver content
"nonce": "d656ebac973df4156271b1648c35****", // nonce to verify signature
"timestamp": 1679389384, // timestamp
"signature": "127094b7853d4808b5a7b54f1dbae8a2bde4a05e4b97fadb91a8e9eb4a232a74" // signature to verify
}
Verify Notification
- Verify that the
timestamp
field is within the allowable range of error, it is recommended to be 30s before and after the current time - According to the rules of How to generate Authorization, use the accout_key, account_id, the returned timestamp field and the nonce field to generate a signature, and compare whether it is consistent with the returned signature field
Fail And Re-push
After receiving the notification, please return a response with http status code 200 immediately. Any non-200 response or timeout (timeout period is 10s now) will be regarded as a push failure, and the notification will be re-push. It is recommended that you return a response immediately after receiving the notification, and then process the push content asynchronously.
The rules for re-push are:
- Re-push every 5 minutes after the push fails
- Up to 5 pushes
- Only push the deliver status of SMS sent within 24 hours