Get Reports (Callback)
Once you have submitted a message and the message has been delivered to the handset, the operator responds with a delivery report. It could take seconds or 48 hours to receive the delivery report from the operator, depending on the network.
In addition, SMS Survey can send you reports whenever your client will open the Survey page and when he click in any link, map or action button of the Survey page.
To use this method you need to specify the url callback in the param "report_url" when you send the message.
Request to your server
When we receive delivery reports we will send to your server instantly in batches, so each request can contain up to 1,000 delivery reports in a JSON format. You can read these request reading the raw POST data on your side.
DLR Request
Array of delivery reports founds.
|
[
{
"sms_id":"034d2acec0eb44af842de6a00bf4d934",
"from":"SUPERGOL",
"to":"34666666666",
"custom":"YourReferenceID-774843",
"sms_date":"2015-06-02 01:43:47",
"status":"DELIVRD",
"dlr_date":"2015-06-02 01:43:50"
},
{
"sms_id":"034d2acec0eb44af842de6a00bf4d892",
"from":"SUPERGOL",
"to":"34666666666",
"custom":"YourReferenceID-774849",
"sms_date":"2015-06-02 01:43:47",
"status":"DELIVRD",
"dlr_date":"2015-06-02 01:43:49"
}
]
Two delivery reports sent
Status values
DELIVRD | Message delivered to destination. |
ACCEPTD | Message is in accepted state, this state is temporary. |
EXPIRED | Message validity period has expired, the expiration of a message is 48 hours if not specified. |
DELETED | Message has been deleted due to the operator's reasons. |
UNDELIV | Message wasn't delivered by SMSC, expiration, not reachable, operator problems, portability... |
UNKNOWN | Message is in unknown state, the operator is trying, maybe the cellphone is turned off. |
REJECTD | Message is in rejected state, the destination or the operator rejected the message. |
Survey Open Request
|
{
"034d2acec0eb44af842de6a00bf4d934":
{
"msisdn":"34666666666",
"timestamp":"2017-08-07 16:54:40",
"ip":"8.8.8.8",
"city":"Madrid",
"device":"Android",
"user_agent":"Mozilla/5.0 (Linux; Android 7.0; SAMSUNG SM-G950F Build/NRD90M) AppleWebKit/537.36",
"brand":"Samsung",
"model":"Galaxy S8",
"full_name":"Samsung Galaxy S8",
"marketing_name":"SAMSUNG SM-G950F"
}
}
Survey Completed Request
The response obtained in this request will depends of the structure of the survey created in your account and the sequence of those fields will be the same, being this the list of possible fields:
- checkbox-X
- radio-X
- textarea-X
- select-X
- date-X
- time-X
X value corresponds to an identifier of the number of elements of that type, starting at 1.
|
{
"034d2acec0eb44af842de6a00bf4d934":
{
"msisdn":"34666666666",
"timestamp":"2017-08-07 16:54:53",
"response":{
"radio-1": {
"type": "radio",
"question": "Have you bought in our shop before?",
"answers": {
"predefined": [
"No"
]
}
},
"textarea-1": {
"type": "textarea",
"question": "How did you find the purchase process?",
"answers": {
"predefined": [
"Really good and simple"
]
}
},
"radio-2": {
"type": "radio",
"question": "On a scale from 1 to 10, what score would you give us?",
"answers": {
"predefined": [
"9"
]
}
},
"checkbox-1": {
"type": "checkbox",
"question": "What did you like most about our brand?",
"answers": {
"predefined": [
"Simplicity",
"Price"
],
"other": [
"You're awesome!"
]
}
}
}
}
}
Your server response
In order to accept the delivery reports, your server must respond with HTTP status code 200 OK. If you cannot process the data at this time, for example, due to a database problem, you can return any other error such as status code 500. If a status code other than 200 is received, the request will be retried every 30 minutes for a period of 6 hours.