HLR API
DecisionTelecom дозволяє надсилати мережеві запити на будь-який мобільний номер по всьому світу. Це дозволяє переглядати, який номер мобільного телефону належить якомусь оператору в режимі реального часу і бачити, чи активний номер.
HLR API використовує HTTPS з ключем доступу, який використовується як авторизація API. Корисні дані запитів та відповідей форматуються як JSON за допомогою кодування UTF-8 та значень у кодуванні URL.
API Авторизація - Базовий ключ доступу Base64.
Щоб отримати ключ API, будь ласка, зв'яжіться з вашим менеджером по роботі з клієнтами.
Надіслати HLR
https://web.it-decision.com/v1/api/hlr Request JSON:
{
"phones":[380636151111,380631111112]
}Parameters:
Phones: array - The list of phone numbers on which you want to make a network request. - Required.
Response:
Returns JSON string if the request was successful.
[
{
"id": 2345234,
"phone": 380631111111,
"href": "https://web.it-decision.com/v1/api/hlr-status?id=380631111111",
"status": "Accepted"
},
{
"id": 2345235,
"phone": 380631111112,
"href": "https://web.it-decision.com/v1/api/hlr-status?id=380631111112",
"status": "Accepted"
}
] Parameters:
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.
Статус HLR
Request example:
Successful Response Example JSON:
Значення
id: unique random ID generated by DecisionTelecom.
phone: phone 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.
191-Unsupported network for which offers portability status.
192-Unsupported network for which offers the Origin Network.
193-Landline Fixed network (not covered).
Приклади HLR
<?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;
Last updated