HISTORY (GET) - Get the History of a Phone Number Transactions
This endpoint allows you get the history of transactions carried out by a phone number within a given period
Base URL
https://ussd.simhosting.ng/api/history/
Get the history of the transactions carried out by a phone number within a given period. All the requests are submitted through HTTPS GET method. Although you can use HTTP protocol, we strongly recommend you to submit all requests to API over HTTPS so the traffic is encrypted and the privacy is ensured.
PARAMETERS
Parameter | Type | Description |
---|---|---|
token | string | The API authentication token. This can be accessed from API Tokens' page |
phone | string |
The phone number for which the history is needed |
timeframe | string |
The time frame for the summary. Below are valid queries 1h = 1 hour ago 6h = 6 hours ago 12h = 12 hours ago 24h = 24 hours ago 1d = Today 1w = 1 week ago If no time frame is supplied today's value will be returned |
Summary Request Format (HTTPS GET Method)
Sample PHP code to get history for a phone number
<?php
$baseurl = "https://ussd.simhosting.ng/api/history/?";
$status_array = array (
"token" =>"API_TOKEN_HERE",
"phone" =>"PHONE_NUMBER"
"timeframe" =>"TIME_FRAME"
);
$status_url = $ussd_base.http_build_query($status_array);
$response = file_get_contents($status_url);
echo $response; // response code
?>
USSD Response Format
All response are in the format below:
{json data}
Response on Success
{ "success": true, "comment": "History loaded successfully for +2348000000000.", "data": [
{
"log_id":100000000,
"ref_id":"1234567890",
"type":"shortcode",
"query":"Text SMEC 08130000000 1000 0000 to 131",
"code":"2",
"response":"You have successfully transferred 1000MB Data to 2348130000000.",
"time_submitted":"2020-05-28 17:27:42",
"time_replied":"2020-05-28 17:28:06"
},
{
"log_id":200000000,
"ref_id":"0987654321",
"type":"shortcode",
"query":"Text SMEC 08130000000 2000 0000 to 131",
"code":"2",
"response":"You have successfully transferred 2000MB Data to 2348130000000.",
"time_submitted":"2020-05-28 17:27:42",
"time_replied":"2020-05-28 17:28:06"
}
]
}
Response on Failure
{
"success": "false",
"comment": "ADDITIONAL_COMMENT"
}