For the complete documentation index, see llms.txt. This page is also available as Markdown.

HLR API

DecisionTelecom позволяет отправлять сетевые запросы на любой мобильный номер по всему миру. Это позволяет вам просматривать, какой номер мобильного телефона принадлежит какому оператору в режиме реального времени и видеть, активен ли номер.

HLR API использует HTTPS с ключом доступа, который используется в качестве авторизации API. Полезные данные запросов и ответов форматируются как JSON с использованием кодировки UTF-8 и значений в кодировке URL.

API Авторизация - Базовый ключ доступа Base64.

Чтобы получить ключ API, пожалуйста, свяжитесь с вашим менеджером по работе с клиентами.

Отправить HLR

 https://web.it-decision.com/v1/api/hlr 
{
    "phones":[380636151111,380631111112]
}

Параметры:

Phones: array - Список номеров телефонов, по которым вы хотите выполнить сетевой запрос. – Обязательный.

Response:

Возвращает JSON string если запрос был успешным.

[
 {
          "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"
 }
]  

Параметры:

Id int - Уникальный случайный идентификатор, созданный на платформе DecisionTelecom. Обязательный.

status string – состояние телефона.

Возможные значения: accepted, sent, absent, active, unknown, and failed.

Статус HLR

Пример запроса:

Пример ответа JSON:

Значения

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.

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