This command will retrieve history of single messages sent.
https://api.textlocal.in/get_history_single/
<?php // Account details $apiKey = urlencode('Your apiKey'); // Prepare data for POST request $data = array('apikey' => $apiKey); // Send the POST request with cURL $ch = curl_init('https://api.textlocal.in/get_history_single/'); curl_setopt($ch, CURLOPT_POST, true); curl_setopt($ch, CURLOPT_POSTFIELDS, $data); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); $response = curl_exec($ch); curl_close($ch); // Process your response here echo $response; ?>
<?php // Account details $apiKey = urlencode('Your apiKey'); // Prepare data for POST request $data = $apiKey; // Send the GET request with cURL $ch = curl_init('https://api.textlocal.in/get_history_single/?' . $data); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); $response = curl_exec($ch); curl_close($ch); // Process your response here echo $response; ?>
<?php require('Textlocal.class.php'); $Textlocal = new Textlocal(false, false, 'your apiKey'); $min_time = time(); // Get sends between now $max_time = strtotime('-1 month'); // and a month ago $limit = 1000; $start = 0; $response = $Textlocal->getSingleMessageHistory($start, $limit, $min_time, $max_time); print_r($response); ?>
There are no additional parameters for this command | |
Login Parameters (Additional Information) | |
apiKey | You can create these in your Messenger Control Panel (click here) for each application, and limit the usage of them by host IP Address. |
Optional Parameters | |
min_time | Unix timestamp format of the oldest message. If not provided defaults to 6 months ago as of today. |
max_time | Unix timestamp format of the newest message. If not provided defaults to current time. |
sort_order | Order in which to sort the response. Either asc or desc. If not provided defaults to desc. |
start | Used in conjunction with limit to return a set of messages starting at the position given (such as 24), up to and including the limit. |
limit | Limit result set returned to a specific number of records. If not provided defaults to 1000. |
{ "start":0, "limit":1000, "total":2, "messages":[{ "number":918123456789, "content":"This is your message", "datetime":"2013-07-04 11:34:47", "status":"D" }, { "number":918987654321, "content":"This is your other message", "datetime":"2013-07-03 16:32:46", "status":"D" }], "status":"success" }
<?xml version="1.0" encoding="UTF-8" ?> <response> <start>0</start> <limit>1000</limit> <total>2</total> <messages> <message> <number>918123456789</number> <content>This is your message</content> <datetime>2013-03-04 11:34:47</datetime> <status>D</status> </message> <message> <number>918987654321</number> <content>This is your other message</content> <datetime>2013-03-03 16:32:46</datetime> <status>D</status> </message> </messages> <status>success</status> </response>
Error Codes | |
45 | Invalid sort field. |
---|---|
46 | Invalid limit value. |
47 | Invalid sort direction. |
48 | Invalid timestamp. |
63 | Invalid start specified. |