STATUS (GET) - Get the Status of a Submitted Query
This documentation has been improved and can be found on our PostMan Documentation page.
This endpoint allows you to get the status of a submitted query using either the refid supplied with the query or the log_id returned after the query was submitted.
Base URL
https://ussd.simhosting.ng/api/status/
Get the status of the query previously sent to the server. All the requests are submitted through the HTTPS GET method. Although you can use HTTP protocol, we strongly recommend you submit all requests to API over HTTPS so the traffic is encrypted and privacy is ensured.
PARAMETERS
Parameter | Type | Description |
---|---|---|
token | string | The API authentication token. This can be accessed from API Tokens' page |
refid | string | The refid that was supplied with the query. Optional. |
log_id | integer | The log_id returned on successful query submission. |
Status Request Format Using refid (HTTPS GET Method)
Sample PHP code to get query status via refid
<?php
$baseurl = "https://ussd.simhosting.ng/api/status/?";
$status_array = array (
"token" =>"API_TOKEN_HERE",
"refid" =>"CUSTOM_ID_SUPPLIED_WITH_THE_QUERY"
);
$status_url = $ussd_base.http_build_query($status_array);
$response = file_get_contents($status_url);
echo $response; // response code
?>
Status Request Format Using log_id (HTTPS GET Method)
Sample PHP code to get query status via refid
<?php
$baseurl = "https://ussd.simhosting.ng/api/status/?";
$status_array = array (
"token" =>"API_TOKEN_HERE",
"log_id" =>"THE_LOG_ID_RETURNED_ON_SUCCESSFUL_SUBMISSION"
);
$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": "Status query successful", "data": { "type": "shortcode", "query": "Text 2 to 131", "code": "2", "response": "Your data balance is 10MB. Expires 01/05/2020", "time_submitted": "2020-04-14 09:33:25", "time_replied": "2020-04-14 09:33:32" } }
The table below shows the meaning of the code values
Code | Meaning |
---|---|
0 | Pending |
1 | Running. Server is currently running the query |
2 | Successful |
3 | Failed |
4 | Unknown |
Response on Failure
{
"success": "false",
"comment": "ADDITIONAL_COMMENT"
}