Overview
Telecom Lookup Tools
Powered By GitBook
Get SMS Records
Get SMS CDR Records for a Specific Time Period.

Get Information

URL:
[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://api.teleapi.net/smscdr/[start]/[end]?token=XXXXXX&direction=inbound​
Optional: source=5555555555 to get only records for source number 5555555555. Can be mixed with destination=... https://api.teleapi.net/smscdr/[start]/[end]?token=XXXXXX&source=5555555555​
Optional: destination=5555555555 to get only records for destination number 5555555555. Can be mixed with source=... https://api.teleapi.net/smscdr/[start]/[end]?token=XXXXXX&source=5555555555 ​https://api.teleapi.net/smscdr/[start]/[end]?token=XXXXXX&source=5555555555&destination=4444444444​
Optional: canada=yes to get only records sent to Canadian destinations https://api.teleapi.net/smscdr/[start]/[end]?token=XXXXXX&canada=yes​
Full Sample URL:
1
https://api.teleapi.net/smscdr/04-24-2017/04-26-2017?token=ABC-ABC-ABC
Copied!
shell
PHP+CURL
RESPONSE
CURL
1
curl -v -X GET "https://api.teleapi.net/smscdr/04-24-2017/04-26-2017/?token=XXXX"
Copied!
PHP + Curl
1
<?php
2
$start_date = "04-24-2017";
3
$end_date = "04-26-2017";
4
​
5
$baseurl = "https://api.teleapi.net/smscdr/";
6
$baseurl .= $start_date."/".$end_date."/?token=XXXX";
7
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
8
$retval = curl_exec($ch);
9
curl_close($ch);
10
​
11
$object = json_decode($retval);
12
print_r($object);
Copied!

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.
1
date gmt,source,destination,direction,type,cost
2
2017-04-22 00:15:30,7205551212,3035551212,out,sms,0.003500
Copied!

Invalid Date Range

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

Failed to Download

1
{
2
"status":"error",
3
"error":"invalid date"
4
}
Copied!
Last modified 1yr ago
Copy link