Get SMS History
Get SMS history from your TxTRIA account
POST
https://txtria.net/api/smshistory
Query Parameter
Key | Description | Required | Example |
---|---|---|---|
number | Phone number you want to fetch records for | Yes | 832324XXXX |
tid | TxTRIA number tid | Yes | 562742XXXX |
history_start | integer, fetching records will start from this number | Yes | 1 |
history_end | integer, fetching records will end on this number | Yes | 100 |
sys_id | Your TxTRIA sys_id | Yes | ACfc98e7b0aae031b9h... |
auth_token | Your TxTRIA account token | Yes | c74eac89884a126a2c... |
$url = 'https://txtria.net/api/smshistory';
$data = array(
'tid' => '7887978HG',
'number' => '562742XXXX',
'history_start' => '1',
'history_end' => '100',
'sys_id' => 'ACfc98e7b0aae031b9fa',
'auth_token' => 'c74eac89884a126a2cca'
);
$ch = curl_init();
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
$response = curl_exec($ch);
curl_close($ch);
echo $response;
Example Response
{
"success": "1",
"message_count_requested ": 100,
"total_message_count": 600,
"created_date": "2011-04-04 05:35:09",
"most_recent_msg_id": 42542566,
"most_recent_date": "2024-11-05 10:21:01",
"tid": "JFKLDSA09809",
"number": "8323232323",
"optin": "yes",
"messages": [
{
"system_id": 54235325642,
"message_id": "d9b9360b275b4dad86a3291749c9f9e4",
"GMTdate": "2019-08-26 06:33:21",
"tid": "HJK685643253",
"phone": "83232323232",
"direction": "outbound",
"body": "Hello world!",
"mms": "no",
"mms_url": "",
"status": "200 [Possible status and meaning: 200 = success, 400 = error]"
},
{
"system_id": 542353256423,
"message_id": "d9b9360b2375b4dad86a3291749c9f9e4",
"GMTdate": "2019-08-24 06:33:21",
"tid": "HJK6856543253",
"phone": "83232423232",
"direction": "outbound",
"body": "Hello world!",
"mms": "yes",
"mms_url": "https:\/\/somedomain.com\/img.png",
"status": "200 [Possible status and meaning: 200 = success, 400 = error]"
}
]
}