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

POST to https://api.intelepeer.com/sms/v1/mdr

 

Parameters

This API method requires an Authorization Token. Learn more about the Authorization token in Atmosphere® API Authentication.

ParameterData TypeRequiredDescription
refidstringrequiredThe refid of the message returned by calling the send method.

 

Request Example
{
    "refid": SM5AC09A610001006568100005C32E9D",
}

 

Response Example
{
    "RCC_en": "ACCEPTED",
    "RCC": 3000
}

 

Response Variable Values
VariableAvailable Values
RCC_en
  • CREATED
  • ENQUEUED
  • ACCEPTED
  • FAILED
  • DELIVERED
  • UNKNOWN

 

Response Codes
Response CodeDescription
202MDR Returned
401Authorization token has expired
404Record 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:

  1. Message queued for delivery
  2. Message delivered to the mobile carrier
  3. Message delivered to end-customer
  4. In some cases, message delivery may fail due to carrier SPAM filters or other carrier-specific restrictions

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

Java

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/sms/v1/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<NameValuePair> urlParameters = new ArrayList<NameValuePair>();
		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());
    }
}

 

Node.js

const request = require("request");

///////////////////////////////////////////////////////////////////////////////
/// update these accordingly                                                ///
///////////////////////////////////////////////////////////////////////////////
let authtoken = 'INSERT_AUTH_TOKEN_HERE'
let refid     = 'INERT_REFID_HERE'

///////////////////////////////////////////////////////////////////////////////
/// leave these alone                                                       ///
///////////////////////////////////////////////////////////////////////////////
let url       = "https://api.intelepeer.com/sms/v1/mdr"
let payload   = { 'refid': refid }
let hdrs      = {
    'Content-Type': "application/json",
    'Authorization': "Bearer " + authtoken
}
///////////////////////////////////////////////////////////////////////////////
/// execute the task and parse results                                      ///
///////////////////////////////////////////////////////////////////////////////
request.post({
    url: url,
    headers: hdrs,
    form: payload
},
(error, response, body) => {        
    let result = JSON.parse(body);
    console.log(result.text);
});

 

PHP

<?php

require '../vendor/autoload.php';
use GuzzleHttp\Client;

###############################################################################
### update these accordingly                                                ###
###############################################################################
$authtoken = 'INSERT_AUTH_TOKEN_HERE';
$refid     = 'INERT_REFID_HERE';

###############################################################################
### leave these alone                                                       ###
###############################################################################
$url  = "https://api.intelepeer.com/sms/v1/mdr";
$hdrs = ['Content-Type' => "application/json",
         'Authorixation' => 'Bearer '.$authtoken];
$payload = [ 'refid' => $refid ];

###############################################################################
### execute the task and parse results                                      ###
###############################################################################

try{
  $client = new Client();
  $response = $client->post($url, [
    'headers' => $hdrs,
    'json' => $payload
    ]);
}
catch (RequestException $e){
  echo "Request Failed:". $e->getMessage();
}

echo $response->getBody();
?>

 

Python

import requests
from datetime import datetime

###############################################################################
### update these accordingly                                                ###
###############################################################################
authtoken = 'INSERT_AUTH_TOKEN_HERE'
refid     = 'INERT_REFID_HERE'

###############################################################################
### leave these alone                                                       ###
###############################################################################
url       = "https://api.intelepeer.com/sms/v1/mdr"
payload   = { 'refid': refid }
hdrs      = {
    'Content-Type': "application/json",
    'Authorization': 'Bearer {}'.format(authtoken)
    }

###############################################################################
### execute the task and parse results                                      ###
###############################################################################
response = requests.post(url, json=payload, headers=hdrs)
print u'{}: {}'.format('OK' if response else 'ERROR', response.text )