Delivery report
When sending a message with the messages api call you can choose to have the delivery notifications forwardet to a local web service of your choosing.
Enable status requests
To enable status requests you have to tell the REST api to enable the requests, it is done by using the [status] and [statusurl] options described in messages
An example call could look like this
POST /v2/message.json?apikey=99dce21afab244649d8fc7477cf330976662c9ac266e207e16f0a70faeba0f0d HTTP/1.1 Host: api.linkmobility.dk Content-Type: application/json { "message":{ "recipients": "+4512721272", "sender": "TEST", "message": "Hello world!", "status": true, "statusurl": "http://example.org/dlr.php", "returndata": "my-own-data" } }
HTTP status request
The HTTP GET status request is done every time a message changes status
The request you get back would look like this :
GET /dlr.php?status=received&reason=&receivetime=1433242301&msgid=f5ffcafa047c107c8978c9318ddc5955&to=4512721272&statuscode=0&returndata=my-own-data&logdate=2015_06_02&mcc=238&mnc=1&batchid=6681153 HTTP/1.1 array ( 'status' => 'received', 'reason' => '', 'receivetime' => '1433242301', 'msgid' => 'f5ffcafa047c107c8978c9318ddc5955', 'to' => '4512721272', 'statuscode' => '0', 'returndata' => 'my-own-data', 'logdate' => '2015_06_02', 'mcc' => '238', 'mnc' => '1', 'batchid' => '6681153', )
Status can contain the following values
Status | Description |
---|---|
received | The message is received |
rejected | The message is rejected by the SMSC. (Please see the list of status codes for an explanation) |
buffered | The message was not delivered and will try to get sent again at another time |
expired | The validity period has expired, the message wasn't delivered |
When the customer URL is called, it will have the following parameters specified:
Name | Description |
---|---|
batchid | Batch id |
msgid | The unique ID of the message |
receivetime | UNIX Timestamp for the Delivery Notification |
to | The recipient of the message, for which we have status report of |
status | Status of the message (recieved, rejected, buffered, expired) |
reason | Description of the current status |
statuscode | The status code for the message, according to the errorcodes below |
returndata | If the returndata parameter was set when sending the message, the parameter will hold the value for the given message of the customer |
logdate | The date of when the message was sent, in the format YYYY_mm_dd |
mcc | Countrycode |
mnc | Operatorcode |
push_price | If premium message, the push_price is also sent |
Statuscodes :
Code | Description |
---|---|
0 | Unknown subscriber |
1 | Service temporary not available |
2 | Service temporary not available |
3 | Service temporary not available |
4 | Service temporary not available |
5 | Service temporary not available |
6 | Service temporary not available |
7 | Service temporary not available |
8 | Service temporary not available |
9 | Illegal error code |
10 | Network time-out |
50 | Error in MS |
100 | Facility not supported |
101 | Unknown subscriber |
102 | Facility not provided |
103 | Call barred |
104 | Operation barred |
105 | SC congestion |
106 | Facility not supported |
107 | Absent subscriber |
108 | Delivery fail |
109 | SC congestion |
110 | Protocol error |
111 | MS not equipped |
112 | Unknown SC |
113 | SC congestion |
114 | Illegal MS |
115 | MS not a subscriber |
116 | Error in MS |
117 | SMS lower layer not provisioned |
118 | System fail |
119 | PLMN system failure |
120 | HLR system failure |
121 | VLR system failure |
122 | Previous VLR system failure |
123 | Controlling MSC system failure |
124 | VMSC system failure |
125 | EIR system failure |
126 | System failure |
127 | Unexpected data value |
128 | Message encoding not supported |
200 | Error in address service centre |
201 | Invalid absolute Validity Period |
202 | Short message exceeds maximum |
203 | Unable to Unpack GSM message |
204 | Unable to convert IRA ALPHANBET |
205 | Invalid validity period format |
206 | Invalid destination address |
207 | Duplicate message submit |
208 | Invalid message type indicator |
104 | Operation barred - Deres saldo er ikke høj nok til at gennemfør takseringen |
114 | Illegal MS - Brugeren har spærret for overtaksering, enten tjenesten, shortcoden eller generelt |
209 | Refunderet via operatøren |
210 | Could not refund |
211 | Refund queued |
Feeling lost? Click on this link! Portal page