Search
The search API allows businesses verify phone numbers and automatically detect their status as well as current network. It also tells if the number has activated the do-not-disturb settings.
Endpoint :
https://BASE_URL/api/check/dnd?api_key=my_api_key&phone_number=phone_number
Request Type : GET
Options | Required | Description |
---|---|---|
api_key | yes | string Your API key (It can be found on your Termii dashboard). |
phone_number | yes | string Represents the phone number to be verified. Phone number must be in the international format ( Example: 23490126727 ) |
DND represents Do-Not-Distrub routes and messages sent to phone numbers with DND settings activated are blocked by telcom providers.
To ensure your messages deliver, use the dnd channel.
{
"api_key": "Your API key",
"phone_number": "2348753243651"
}
var data = {
"api_key": "Your API key",
"phone_number": "234875324365"
};
var data = JSON.stringify(data);
var xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener("readystatechange", function() {
if(this.readyState === 4) {
console.log(this.responseText);
}
});
xhr.open("GET", "https://BASE_URL/api/check/dnd");
xhr.setRequestHeader("Content-Type", "application/json");
xhr.setRequestHeader("Content-Type", "application/json");
xhr.send(data);
var request = require('request');
var data = {
"api_key": "Your API key",
"phone_number": "2348753243651"
};
var options = {
'method': 'GET',
'url': 'https://BASE_URL/api/check/dnd',
'headers': {
'Content-Type': ['application/json', 'application/json']
},
body: JSON.stringify(data)
};
request(options, function (error, response) {
if (error) throw new Error(error);
console.log(response.body);
});
import requests
url = "https://BASE_URL/api/check/dnd"
payload = {
"api_key": "Your API key",
"phone_number": "2348753243651"
}
headers = {
'Content-Type': 'application/json',
}
response = requests.request("GET", url, headers=headers, json=payload)
print(response.text)
RestClient restClient = new RestClient("https://BASE_URL/api/check/dnd");
//Creating Json object
JObject objectBody = new JObject();
objectBody.Add("api_key","Your API Key");
objectBody.Add("phone_number","+2348753243651");
RestRequest restRequest = new RestRequest(Method.GET);
restRequest.AddHeader("Content-Type", "application/json");
restRequest.AddParameter("application/json", objectBody, ParameterType.RequestBody);
IRestResponse restResponse = restClient.Execute(restRequest);
Console.WriteLine(restResponse.Content);
Unirest.setTimeouts(0, 0);
HttpResponse<String> response = Unirest.get("https://BASE_URL/api/check/dnd")
.header("Content-Type", "application/json")
.body("{\r\n \"api_key\": \"Your API Key\",\r\n \"phone_number\": \"2348753243651\"\r\n }")
.asString();
$curl = curl_init();
$data = array ( "api_key" => "Your API key","phone_number" => "+2348753243651",);
$post_data = json_encode($data);
curl_setopt_array($curl, array(
CURLOPT_URL => "https://BASE_URL/api/check/dnd",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_POSTFIELDS => $post_data,
CURLOPT_HTTPHEADER => array(
"Content-Type: application/json"
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
Response
{
"number": "2347089509657",
"status": "DND blacklisted",
"network": "Airtel Nigeria",
"network_code": "62120"
}