Project

General

Profile

HTTP API hlr

Performs HLR dipping and returns the result.

Arguments

argument mandatory description
_login yes coincides with the user/company login to the personal account
_password yes matches the user/company password to the personal account
number yes number in E.164 format
request_id no Value, assigned by client.
Will be returned to client in response

Returned data

Server returns response in JSON API format.
Response will contain one of:

  • errors.
    Array of errors, occured when processing the request.
  • data.
    JSON object, which contains request results, in case if request from client contains 1 number.
    Array of JSON objects, in case if request from client contains several numbers.

errors and data will not be present in 1 response simultaneously.
Each response contains either errors, or data.

data can contain following attributes:
attribute mandatory description
id yes response ID assigned by server
type yes "hlr"
number yes requested number
status yes ок - information has been successfully retrieved, balance has been charged for the request,
error - information hasn't been retrieved, balance hasn't been charged for the request
mcc no MCC of the requested number
mnc no MNC of the requested number
imsi no IMSI of the requested number
reachable no reachability status of the subscriber having requested number (true - reachable, false - unreachable)
roaming no roaming status of the subscriber having requested number (true - subscriber is in roaming, false - subscriber is not in roaming)
request_id yes, if client has passed request_id inside the request argument that has been passed by the client
errors can contain following attributes:
attribute mandatory description
code yes Short error code.
Can be used by a client for conditional error handling.
It doesn't depend on a client's locale.
detail yes Error details.
Can be used by a client to display inside contents of a error dialog.
Can be returned by the server in a locale of a client.
title yes Error title.
Can be used by a client to display in the header of the error dialog.
Can be returned by the server in a locale of a client.

Examples

Dipping 1 number

request GET "https://your.server.name/api/hlr?number=79183035536&request_id=1&_login=LOGIN&_password=PASSWORD"
response
{
    "data" : {
        "attributes" : {
            "mcc" : "250",
            "mnc" : "001",
            "number" : "79183035536",
            "status" : "ok" 
        },
        "id" : "1561370632513",
        "meta" : {
            "request_id" : "1" 
        },
        "type" : "hlr" 
    }
}

Dipping 2 numbers

request GET "https://your.server.name/api/hlr?number=79183035536&request_id=1&number=79183035537&request_id=2&_login=LOGIN&_password=PASSWORD"
response
{
    "data" : [
        {
            "attributes" : {
                "mcc" : "250",
                "mnc" : "001",
                "number" : "79183035536",
                "status" : "ok" 
            },
            "id" : "1561371433517",
            "meta" : {
                "request_id" : "1" 
            },
            "type" : "hlr" 
        },
        {
            "attributes" : {
                "mcc" : "250",
                "mnc" : "001",
                "number" : "79183035537",
                "status" : "ok" 
            },
            "id" : "1561371433518",
            "meta" : {
                "request_id" : "2" 
            },
            "type" : "hlr" 
        }
    ]
}

Error

request GET "https://your.server.name/api/hlr?number=79183035536&request_id=1&_login=LOGIN&_password=PASSWORD"
response
{
    "errors" : [
        {
            "code" : "authentication",
            "detail" : "Please check your login and password",
            "title" : "Authentication error" 
        }
    ]
}

Русский перевод

Also available in: PDF HTML TXT