SMS Detailed Records

Get SMS CDR Records for a Specific Time Period.

Get Information

URL:

https://cdr.teleapi.net/sms/[start_date]/[end_date]?token=XXXXXXX

[start_date] would be month-day-year or 04-24-2017
[end_date] would be month-day-year or 04-26-2017

Optional: direction=inbound to get inbound SMS records
https://cdr.teleapi.net/sms/\[start\]/\[end\]?token=XXXXXX&direction=inbound

Optional: source=5555555555 to get only records for source number 5555555555. Can be mixed with destination=... https://cdr.teleapi.net/sms/\[start\]/\[end\]?token=XXXXXX&source=5555555555

Optional: destination=5555555555 to get only records for destination number 5555555555. Can be mixed with source=... https://cdr.teleapi.net/sms/\[start\]/\[end\]?token=XXXXXX&source=5555555555 https://cdr.teleapi.net/sms/\[start\]/\[end\]?token=XXXXXX&source=5555555555&destination=4444444444

Full Sample URL:

https://cdr.teleapi.net/sms/04-24-2017/04-26-2017?token=ABC-ABC-ABC

CURL

curl -v -X GET  "https://cdr.teleapi.net/sms/04-24-2017/04-26-2017/?token=XXXX"

PHP + Curl

<?php
$start_date = "04-24-2017";
$end_date = "04-26-2017";

$baseurl = "https://sms.teleapi.net/cdr/";
$baseurl .= $start_date."/".$end_date."/?token=XXXX";
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$retval = curl_exec($ch);
curl_close($ch);

$object = json_decode($retval);
print_r($object);

Responses from API

Successful Download

This is a sample of what to expect from the API. If you open this in a web browser, it will download a file for you.

date gmt,source,destination,direction,type,cost
2017-04-22 00:15:30,7205551212,3035551212,out,sms,0.003500

Invalid Date Range

The code may return an empty set if the date range cannot get a result.

Failed to Download

{
   "status":"error",
   "error":"invalid date"
}

results matching ""

    No results matching ""