Checking Message Status
You can check the status of an outbound message any time after it has been sent.
Visit Sending Messages to learn more about sending an SMS message.
Checking Outbound Message Status
You can check the delivery status of a message with a single call to the Atmosphere® Messaging API.
URI
For EU numbers, POST to https://eu.api.intelepeer.com/_rest/v4/app/sms/mdr
For all other numbers, POST to https://api.intelepeer.com/_rest/v4/app/sms/mdr
Parameters
This API method requires an Authorization Token. Learn more about the Authorization token in Atmosphere® API Authentication.
Parameter | Data Type | Required | Description |
---|---|---|---|
refid | STRING | Required | The refid of the message returned by calling the send method. |
Request Example
{
"refid": SM5AC09A610001006568100005C32E9D",
}
200 OK Examples
{
"code": 200,
"RCC_en": "Queued",
"RCC": 0
}
{
"code": 200,
"RCC_en": "Sent",
"RCC": 10000
}
{
"code": 200,
"RCC_en": "DLR:Delivered",
"RCC": 210000
}
{
"code": 200,
"RCC_en": "Failed",
"RCC": 6009
}
401 Unauthorized Examples
{
"detail": "unauthorized"
}
{
"error": "token has expired"
}
Response Variable Values
Variable | Available Values |
---|---|
RCC_en |
Queued Processing Failed Sent DLR:Delivered DLR:Expired DLR:Deleted DLR:Undeliverable DLR:Accepted DLR:Unknown DLR:Rejected |
Note: For more information about DLR values see Table B-2: Delivery Receipt Short Message Text Format of the Short Message Peer to Peer Protocol Specification v3.4
Response Codes
Response Code | Description |
---|---|
200 | MDR Returned |
401 | Authorization token has expired or invalid |
404 | Record not found |
Behavior
Messages sent through the Atmosphere® Messaging API are queued for quick and reliable delivery to the destination carrier and ultimately to the end-user’s phone.
The message’s lifecycle is as follows:
- Message queued for delivery
- Message delivered to the mobile carrier
- Message delivered to end-customer
Note: In some cases, message delivery may fail due to carrier SPAM filters or other carrier-specific restrictions. With Verizon specifically, message delivery may fail due to the destination number being deactivated (“rccdata”: “deactivatedmdndb”)
There may be delays in delivery a message to the end-customer due to:
- Throttling enforced by IntelePeer to improve message delivery
- Throttling or SPAM controls enforced by the mobile carrier
- The end customers handset being out of service area, turned off, or in airplane mode
Example Code
package main.java.mdr;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.List;
import org.apache.http.HttpHeaders;
import org.apache.http.HttpResponse;
import org.apache.http.NameValuePair;
import org.apache.http.client.HttpClient;
import org.apache.http.client.entity.UrlEncodedFormEntity;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.impl.client.HttpClientBuilder;
import org.apache.http.message.BasicNameValuePair;
public class MdrStatus {
public static void main(String... args) throws Exception {
final String url = "https://api.intelepeer.com/_rest/v4/app/sms/mdr";
final String AUTH_TOKEN = "INSERT_AUTH_TOKEN_HERE";
final String REFID = "INERT_REFID_HERE"; HttpClient httpclient = HttpClientBuilder.create().build();
HttpPost httpPost = new HttpPost(url);
// add header
httpPost.setHeader(HttpHeaders.CONTENT_TYPE, "application/json");
httpPost.setHeader(HttpHeaders.AUTHORIZATION, "Bearer " + AUTH_TOKEN);
// Data to be posted
List urlParameters = new ArrayList();
urlParameters.add(new BasicNameValuePair("refid", REFID));
// add data to post
httpPost.setEntity(new UrlEncodedFormEntity(urlParameters));
// execute post
HttpResponse response = httpclient.execute(httpPost);
// show post results
System.out.println("nSending 'POST' request to URL : " + url);
System.out.println("Post parameters : " + httpPost.getEntity());
System.out.println("Response Code : " +
response.getStatusLine().getStatusCode());
BufferedReader rd = new BufferedReader(
new InputStreamReader(response.getEntity().getContent()));
StringBuffer result = new StringBuffer();
String line = "";
while ((line = rd.readLine()) != null) {
result.append(line);
}
System.out.println(result.toString());
}}