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.

  1. Log in to Gupshup Enterprise SMS.
  2. Click on Settings in the menu bar.
  3. Under Advanced Account Settings, you can see Realtime Delivery URL.
621

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 CodeError NameDescription
1ABSENT_SUBSCRIBERWhen the service provider fails to reach the member/subscriber, this
value is passed.
2CALL_BARREDSubscribers have some kind of call barring activity on the number due to which messages from unknown sources are blocked.
3UNKNOWN_SUBSCRIBERUnknown/invalid number.
4SERVICE_DOWNOperator service is temporarily down.
5SYSTEM_FAILUREFailure due to a problem in the Operator’s systems (Originating or
Destination Operator).
6DND_FAILThe number is either in DND or Blocked due to being in DND or a complaint.
7BLOCKED
8DND_TIMEOUTThe latest DND status is not available in time for the message to be sent. (Max 1 day).
9OUTSIDE_WORKING_HOURSMessage sending is outside mentioned working hours.
00a, 14, 15, 16, 17, 18, 19, 01a, 01b, 01c, 20, 24OTHERMessages that are sent but can not be delivered for reasons that don’t fall under any mentioned category.
00bBLOCKED_MASKMask is blocked by SMS GupShup.
00cSMSCTIMEDOUT
00dCANCEL_CAUSEID
00eCANCEL_SCHEDULE
10DEFERRED
11INBOXFULL
12CONGESTION
13NO_ACK_FROM_OPERATOR
22BLOCKED_FOR_USER
23UNKNOWN_SUBSCRIBER
038MSG_DOES_NOT_MATCH_TEMPLATEThe template passed in the message content does not match with dltTemplateId uploaded offline in the system.