Number Lookup (HLR)
HLR lookup is a method to determine the current service provider of a mobile subscriber.
POSThttps://api.vertexsms.com/hlr
Submits the provided msisdn for HLR lookup. If operation is successful - returns HTTP status code 200 OK
Required parameters
| Field | Type | Description |
|---|---|---|
| msisdn | string | International subscriber number, of which HLR status is desired. |
| callBackUrl | url | Where to deliver HLR lookup result for the provided msisdn |
Request example:
REQUEST EXAMPLEPOST
POST /hlr HTTP/1.1
Host: api.vertexsms.com
Content-Type: application/json
Accept: application/json
X-VertexSMS-Token: eB52vNTPL9fO3rDrx8pYmVnj6nqceHNhnqceHNh
{ "msisdn": "37069912345", "callBackUrl": "http://api.vertexsms.com/hlr_callback?myRequestId=123456" }
Response example:
RESPONSE · 200 OK
HTTP/1.1 200 OK
Content-Type: application/json
Cache-control: no-cache
[1203877133]
HLR Lookup Callback
After an attempt of MSISDN lookup, Vertex server will perform a POST request to your callBackUrl with POST body containing JSON object with HLR data.
Example request (when dlrUrl is set as http://yourserver.com/your_script.php):
CALLBACK EXAMPLEPOST
POST /your_script.php HTTP/1.1
Host: yourserver.com
Content-Type: application/json
{ "id": "1203877133", "error": "0", "imsi": "2460210051600001", "country": "LT", "mcc": "246", "mnc": "021" }
HLR Callback fields explanation
| Field | Type | Description |
|---|---|---|
| id | string | Unique HLR lookup request identifier, which was returned after submitting a MSISDN for HLR lookup. |
| error | integer | You can find all VertexSMS API error codes here |
| imsi | integer | International mobile subscriber identity |
| country | string | Country code in ISO 3166-1 alpha-2 format |
| operatorId | integer | Internal VertexSMS operator identifier. More info |
| mcc | string | Mobile country code MCC list |
| mnc | string | Mobile network code MNC list |
| ported | array | This field will not be empty if number is ported to other operator. This will show origin operator information. On ported number this field will contain those values:
|
Your server responseYour script, which will handle message delivery reports coming to
callBackUrl MUST respond with HTTP status code 200 OK and response body OK. Otherwise, the callback will be considered failed and will be repeated until it succeeds.