HLR HTTP API

Interaction format

API requests are made over the HTTP protocol. Input and output data structures are transmitted in the request and response body in JSON format.

Authorization

Most HTTP API calls require authentication and authorization procedures that link API calls to the required applications in your account.

To do this, each request must contain a header or an X-Authorization argument with a connection token in the AccessKey token format,

For example, the title
POST /apps/activate HTTP/1.1
Host: api.unibell.tech
X-Authorization: AccessKey d8ac9959r12b43545da9034,

either by parameter
POST api.unibell.tech/apps/activate?X-Authorization=AccessKey d8ac9959r12b43545da9034

Response format

The JSON scheme of any response contains a string type status parameter with the following values:

Status valueDescription
okNo errors
invalidAccessKeyErrorInvalid AccessKey
requiredJsonErrorThe request body requires JSON
invalidSchemeErrorInvalid JSON scheme
invalidDataErrorinvalid input data
prohibitedForAppErrorProhibited for this application
prohibitedForServiceErrorProhibited for this service
rpcErrorCommunication error

For example:

    {
        …
        “status”: “ok”
        ....
    }

Sending an HLR request

Request:

POST api.unibell.tech/hlr

    {
        "reference": "123456789",
        "msisdn": "7XXXXXXXXXX",
    }
ParameterTypeDescription
referencestringThe user parameter with which the callback will be called based on the results of the application execution
msisdnstringOutgoing number

Response

    {
        “id”: “XXXXX”,
        “href”: “XXXXX”,
        “msisdn”: “XXXXX”,
        “reference”: “XXXXX”,
        “details”: {},
        “status”: “sent”,
        “createdDateTime”: “XXXX-XX-XX XX:XX:XX”,
        “statusDateTime”: “XXXX-XX-XX XX:XX:XX”,
    } 
ParameterTypeDescription
idstringUnique identifier
msisdnstringOutgoing number
referencestringThe user parameter with which the callback will be called based on the results of the application execution
detailsstring
statusstringThe status of the HLR message, for the newly created — sent
createdDateTimestringDate\time of creation
statusDateTimestringDate\time of status receipt

To get the results of the request execution, a callback over the HTTP/HTTPS protocol can be configured using the POST method. The parameters are passed Content-Type: application/x-www-form-urlencoded.

ParameterTypeDescription
idstringUnique identifier
msisdnstringOutgoing number
referencestringThe user parameter with which the callback will be called based on the results of the application execution
detailsstring
statusstringHLR message status: sent — sent, active — number is active, absent — not active, failed — sending error, unknown — unknown
networkErrCodestringSS7 errors, see below
imsiSubscriber’s IMSI
vlrSubscriber’s VLR
hlrSubscriber’s HLR
mccMCC Networks
mncMNC networks
portedIs the subscriber ported to another network
createdDateTimestringDate\time of creation
statusDateTimestringDate\time of status receipt

Error codes in the status

Possible error codes in the status of messages or HLR requests (network Err Code values):

CodeNameDescription
0No errorThe subscriber exists and is available.
1The subscriber does not existThe specified phone number does not exist.
6The subscriber is offlineThe subscriber’s phone is disconnected or is out of range of the network.
11No SMS serviceMeans that the subscriber cannot receive the SMS message. For example, the service is not connected, or the subscriber is roaming, where message reception is not activated, or the subscriber’s operator does not have an SMS exchange with the current roaming operator. It can also be a landline number without receiving messages.
12Error in the subscriber’s phoneThe message cannot be delivered to the subscriber due to an error in the telephone or SIM card.
13The subscriber is blockedOccurs, for example, if the subscriber’s account has a zero or negative balance, and he is roaming, or is blocked by the operator for prolonged non-payment or voluntarily by the subscriber himself. Also, this error may return if the SIM card is damaged or the PIN and PUK codes of the SIM card are entered incorrectly.
21No service supportService is not supported.
On this page