HLR API
DecisionTelecom allows you to send network requests to any mobile number around the world. This allows you to view which mobile phone number belongs to which operator in real time and see if the number is active.
API Authorization - Basic access key Base64.
Please contact your account manager for an API key.
POST
https://web.it-decision.com/v1/api/hlr
Request JSON:
{
"phones":[380636151111,380631111112]
}
Phones: array - The list of phone numbers on which you want to make a network request. - Required.
Returns JSON string if the request was successful.
[
{
"id": 2345234,
"phone": 380631111111,
"href": "https://web.it-decision.com/api/hlr-status?id=380631111111",
"status": "Accepted"
},
{
"id": 2345235,
"phone": 380631111112,
"href": "https://web.it-decision.com/api/hlr-status?id=380631111112",
"status": "Accepted"
}
]
Id int - A unique random identifier generated by the DecisionTelecom platform. - Required.
status string – phone state.
Possible values: accepted, sent, absent, active, unknown, and failed.
GET
https://web.it-decision.com/v1/api/hlr-status?id=2345234
{
"id": 2345234,
"phone": 38063122121,
"mcc": "255",
"mnc": "06",
"network": "Lifecell",
"ported": false,
"status": 0,
"error": 0,
"type": "mobile",
"present": "yes",
"status_message": "Success"
}
ID: a unique random ID which is created on the DecisionTelecom
Phone: int The telephone number.
MCC: the Mobile Country Code of the current carrier.
MNC: the Mobile Network Code of the current carrier.
Network: the name of the current carrier.
Ported: boolean, true / false / null.
Type: text label: mobile / fixed.
Present: yes/ no / na (not available) – whether the subscriber is present in the network.
Status_message: text, the description of the above ‘status’: Success / Invalid Number / Not allowed country.
Status: number, a code for the outcome of the query:
0 = success
1 = invalid Number
2 = not allowed country
HTTP Unsuccessful Response format, If the status is not 0 (Success), only the number, status and status_message will be returned.
Example Response: { "status_message" : "Invalid Number", "status" : 1 }
Errors:
0-No error.
1-Unknown subscriber: The number is not allocated.
2-The owning network cannot be reached.
3-The network cannot reach the number.
4-The location of the number is not known to the network.
5-The number, as published in HLR, in not known to the MSC.
6-The number is absent for SM.
7-Unknown equipment.
8-Roaming not allowed.
9-Illegal subscriber.
10-Bearer service not provisioned.
11-Tele-service not provisioned.
12-Illegal equipment.
13-Call barred.
21-Facility not supported.
27-Phone switched off.
28-Incompatible terminal.
31-The subscriber is busy.
32-The delivery of the SM has failed.
33-A congestion (a full waiting list) occurred.
34-System failure.
35-Missing data.
36-Data error.
cURL
PHP
GOLANG
JAVA
C#
C - libcurl
NodeJS
Python
Ruby
curl --location --request POST 'https://web.it-decision.com/v1/api/hlr' \
--header 'Authorization: Basic api key' \
--header 'Content-Type: application/json' \
--data-raw '{"phones":[380636151111,380631111112]}'
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'https://web.it-decision.com/v1/api/hlr',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_POSTFIELDS =>'{"phones":[380636151111,380631111112]}',
CURLOPT_HTTPHEADER => array(
'Authorization: Basic api key',
'Content-Type: application/json'
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
package main
import (
"fmt"
"strings"
"net/http"
"io/ioutil"
)
func main() {
url := "https://web.it-decision.com/v1/api/hlr"
method := "POST"
payload := strings.NewReader(`{"phones":[380636151111,380631111112]}`)
client := &http.Client {
}
req, err := http.NewRequest(method, url, payload)
if err != nil {
fmt.Println(err)
return
}
req.Header.Add("Authorization", "Basic api key ")
req.Header.Add("Content-Type", "application/json")
res, err := client.Do(req)
if err != nil {
fmt.Println(err)
return
}
defer res.Body.Close()
body, err := ioutil.ReadAll(res.Body)
if err != nil {
fmt.Println(err)
return
}
fmt.Println(string(body))
}
OkHttpClient client = new OkHttpClient().newBuilder()
.build();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\"phones\":[380636151111,380631111112]}");
Request request = new Request.Builder()
.url("https://web.it-decision.com/v1/api/hlr")
.method("POST", body)
.addHeader("Authorization", "Basic api key")
.addHeader("Content-Type", "application/json")
.build();
Response response = client.newCall(request).execute();
var client = new RestClient("https://web.it-decision.com/v1/api/hlr");
client.Timeout = -1;
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Basic api key");
request.AddHeader("Content-Type", "application/json");
var body = @"{""phones"":[380636151111,380631111112]}";
request.AddParameter("application/json", body, ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
Console.WriteLine(response.Content);
CURL *curl;
CURLcode res;
curl = curl_easy_init();
if(curl) {
curl_easy_setopt(curl, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(curl, CURLOPT_URL, "https://web.it-decision.com/v1/api/hlr");
curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 1L);
curl_easy_setopt(curl, CURLOPT_DEFAULT_PROTOCOL, "https");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "Authorization: Basic api key");
headers = curl_slist_append(headers, "Content-Type: application/json");
curl_easy_setopt(curl, CURLOPT_HTTPHEADER, headers);
const char *data = "{\"phones\":[380636151111,380631111112]}";
curl_easy_setopt(curl, CURLOPT_POSTFIELDS, data);
res = curl_easy_perform(curl);
}
curl_easy_cleanup(curl);
ar https = require('follow-redirects').https;
var fs = require('fs');
var options = {
'method': 'POST',
'hostname': 'web.it-decision.com',
'path': '/v1/api/hlr',
'headers': {
'Authorization': 'Basic api key',
'Content-Type': 'application/json'
},
'maxRedirects': 20
};
var req = https.request(options, function (res) {
var chunks = [];
res.on("data", function (chunk) {
chunks.push(chunk);
});
res.on("end", function (chunk) {
var body = Buffer.concat(chunks);
console.log(body.toString());
});
res.on("error", function (error) {
console.error(error);
});
});
var postData = JSON.stringify({
"phones": [
380636151111,
380631111112
]
});
req.write(postData);
req.end();
import http.client
import json
conn = http.client.HTTPSConnection("web.it-decision.com")
payload = json.dumps({
"phones": [
380636151111,
380631111112
]
})
headers = {
'Authorization': 'Basic api key',
'Content-Type': 'application/json'
}
conn.request("POST", "/v1/api/hlr", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
require "uri"
require "json"
require "net/http"
url = URI("https://web.it-decision.com/v1/api/hlr")
https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = "Basic api key"
request["Content-Type"] = "application/json"
request.body = JSON.dump({
"phones": [
380636151111,
380631111112
]
})
response = https.request(request)
puts response.read_body
Last modified 2mo ago