Table of Contents
Get USSD Requests. Requires “get_ussd” API permission.GET https://androidapi.net/api/get/ussd
Parameter #
Field | Type | Description |
---|---|---|
secret | String | The API secret you copied from (Tools -> API Keys) page |
limit (optional) | Number | Limit the number of results per page.Default value: 10 |
page (optional) | Number | Pagination of results.Default value: 1 |
Success Response Format #
Field | Type | Description |
---|---|---|
status | Number | List of Codes 200 = Success |
message | String | Response message |
data | Array | Array of data |
Error Response Format #
Name | Type | Description |
---|---|---|
status | Number | List of Codes 400 = Invalid parameters 401 = Invalid API secret 403 = Access denied 500 = Something went wrong |
message | String | Response message |
data | Array | Array of data |
PHP Sample #
<?php
$apiSecret = "API_SECRET"; // your API secret from (Tools -> API Keys) page
$cURL = curl_init();
curl_setopt($cURL, CURLOPT_URL, "https://androidapi.net/api/get/ussd?secret={$apiSecret}");
curl_setopt($cURL, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($cURL);
curl_close($cURL);
$result = json_decode($response, true);
// do something with response
print_r($result);
Python Sample #
import requests
# your API secret from (Tools -> API Keys) page
apiSecret = "API_SECRET"
r = requests.get(url = "https://androidapi.net/api/get/ussd", params = {
"secret": apiSecret
})
# do something with response object
result = r.json()
Successful Response #
{
"status": 200,
"message": "USSD Requests",
"data": [
{
"id": 5,
"device": "00000000-0000-0000-d57d-f30cb6a89289",
"sim": 1,
"code": "*143#",
"response": "Sorry! You are not allowed to use this service.",
"status": "completed",
"created": 1645043019
},
{
"id": 6,
"device": "00000000-0000-0000-d57d-f30cb6a89289",
"sim": 1,
"code": "*145#",
"response": "Your balance is 14.60",
"status": "completed",
"created": 1645043024
},
{
"id": 13,
"device": "00000000-0000-0000-d57d-f30cb6a89289",
"sim": 2,
"code": "*121#",
"response": "Sorry! Invalid MMI Code.",
"status": "completed",
"created": 1645413608
}
]
}
Error Response #
{
"status": 400,
"message": "Invalid Parameters!",
"data": false
}