Real Time Delivery Reports
Let's say you have given www.example.com/RealTimeDLR/readurl as the callback URL for a given user account.
Gupshup, can send an HTTP POST or GET request.
Get Request
You can set a callback URL for each group and APIs to receive real-time delivery reports.
- Log in to Gupshup Enterprise SMS.
- Click on Settings in the menu bar.
- Under Advanced Account Settings, you can see Realtime Delivery URL.
Let's say you have given www.example.com/RealTimeDLR/readurl as the callback URL, the format of the URL called by GupShup is as follows:
http://example.com/RealTimeDLR/readurl?externalId=%0&deliveredTS=%1&status=%2&cause=%3&phoneNo=%4
&errCode=%6& noOfFrags=%7&mask=%8
Mask parameter is optional and can be forwarded as per request.
Post Request
The HTTP POST request contains a JSON array of one or more events to the call back URL. A Mmximum of 20 events can be sent in a batch to the callback URL.
Please raise a request to support team ([email protected]) to set post
request URL.
The below response shows a JSON array with two event objects. You will receive a maximum of 20 such events in a batch.
[response=
[
{
"externalId": 3562707498794989059-328736121207676738,
"eventType": “DELIVERED",
"eventTs": 1526347800000,
"destAddr”: 919892488888,
“srcAddr”: TESTIN,
“cause”: ”SUCCESS”,
“errCode”: 000,
“channel”: “SMS,
“noOfFrags”:1
},
{
"externalId": 3798318073013708082-252169030017029882,
"eventType": “FAILED",
"eventTs": 1526347800000,
"destAddr”: 91989237777,
“srcAddr”: ABCDEF,“cause”: ” UNKNOWN_SUBSCRIBER”,
“errCode”: 003,
“channel”: “SMS”,
“noOfFrags”:1
}
]]
The following is the explanation of various parameters:
- externalId - Unique ID for each message.
- deliveredTS - Time of delivery of message as LONG number.
- status - Final status of the message, possible values are SUCCESS, FAILURE or UNKNOWN.
- phoneNo - Phone number of the receiver.
- cause - This is the response you will get depending on the status. Various statuses and their explanation are below.
- Errorcode – Error code assigned to a different failure cause.
- No of frags – one message (fragment) is of 160 characters. Number of charactert states the total count of
fragments. - Mask – Sender ID sent with the sms.
Error Codes
Error Code | Error Name | Description |
---|---|---|
1 | ABSENT_SUBSCRIBER | When the service provider fails to reach the member/subscriber, this value is passed. |
2 | CALL_BARRED | Subscribers have some kind of call barring activity on the number due to which messages from unknown sources are blocked. |
3 | UNKNOWN_SUBSCRIBER | Unknown/invalid number. |
4 | SERVICE_DOWN | Operator service is temporarily down. |
5 | SYSTEM_FAILURE | Failure due to a problem in the Operator’s systems (Originating or Destination Operator). |
6 | DND_FAIL | The number is either in DND or Blocked due to being in DND or a complaint. |
7 | BLOCKED | |
8 | DND_TIMEOUT | The latest DND status is not available in time for the message to be sent. (Max 1 day). |
9 | OUTSIDE_WORKING_HOURS | Message sending is outside mentioned working hours. |
00a, 14, 15, 16, 17, 18, 19, 01a, 01b, 01c, 20, 24 | OTHER | Messages that are sent but can not be delivered for reasons that don’t fall under any mentioned category. |
00b | BLOCKED_MASK | Mask is blocked by SMS GupShup. |
00c | SMSCTIMEDOUT | |
00d | CANCEL_CAUSEID | |
00e | CANCEL_SCHEDULE | |
10 | DEFERRED | |
11 | INBOXFULL | |
12 | CONGESTION | |
13 | NO_ACK_FROM_OPERATOR | |
22 | BLOCKED_FOR_USER | |
23 | UNKNOWN_SUBSCRIBER | |
038 | MSG_DOES_NOT_MATCH_TEMPLATE | The template passed in the message content does not match with dltTemplateId uploaded offline in the system. |
Updated over 2 years ago