Developer Docs

Table of contents

Sending Number Verifier request

PUT (POST is also supported)

Endpoint URL: https://api.bsg.hk/hlr/create

Header:

X-API-KEY: live_asdfasdfq234 
content-type: multipart/form-data

JSON Body RAW:

{
"msisdn":"85228927936",
"reference":"sendHLR0407",
"tariff":9
"callback_url":"https://somelink.com/hlr
}

Scenario 1: Creating a single Number Verifier request

Attention! For this request, the Content-type must be set to multipart/form-data!

In this scenario, 2 parameters are passed (and 2 optional):

Required:

  • msisdn – the phone number for which the Number Verifier request is performed
  • reference – external ID of the Number Verifier request

Optional:

  • tariff – number of the tariff. The default is 0. An integer from 0 to 9.
  • callback_url – overrides the link that will be used to pass information about the Number Verifier request (see below).

If this parameter is incorrect, an error is not generated, but the callback_url from the user configuration (if set) is used.

Example of the correct response:

{
  "error": "0",
  "id": "12123",
  "price": "0.002",
  "currency": "EUR"
}

If the request contains an error:

{
  "error": "11",
  "errorDescription": "Incorrect msisdn"
}

Scenario 2: Creating multiple requests

The payload parameter is passed containing a JSON-encoded array having the following structure:

Header:

X-API-KEY: live_asdfasdfq234 
content-type: multipart/form-data

JSON Body RAW:

[
{"msisdn":"85228927936", 
"reference":"extid13423now"
], 
"tariff":9,
"callback_url":"http://someurl.com/callback/?id=12345"},
[
{"msisdn":"85228927936", 
"reference":"extid13425"
], 
"tariff":9,
"callback_url":"http://someurl.com/callback/?id=12346"}
]

The tariff, callback_url parameters are optional.

In this case, an example of the correct response is:

{"result":
[
{"reference":"extid13423now",
"id":"12345",
"error":"0",
"price":"0.002",
"currency":"EUR"},
{"reference":"extid13425",
"id":"12346",
"error":"0",
"price":"0.002",
"currency":"EUR"}
],
"error":"0", 
"totalprice":"0.004",
"currency":"EUR"}

If the data contains an error, the response will be returned approximately as follows:

{"error":"14",
"errorDescription":"Incorrect payload: missing msisdn"
}

In case of passing of one or more external IDs of Number Verifier-requests already existing in the system, the response will be returned nearly as follows:

{"result":
[
{"reference":"extid13423now",
"id":"12345",
"error":"13",
" errorDescription":"HLR already exists"
}, {"reference":"extid13425",
"id":"12346",
"error":"0",
"price":"0.002",
"currency":"EUR"}
],
"error":"0",
"totalprice":"0.002",
"currency":"EUR"}

That is, for all Number Verifier requests with non-unique (i.e., those that already exist in the system) IDs, error 13 will be returned.

Attention! Upon error 14, Number Verifier requests are not created, even if the payload contained the correctly passed data.

We use cookies (and other similar technologies) to collect data to improve your experience on our site. By using our website, you’re agreeing to the collection of data as described in our Website Data Collection Policy.