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 value | Description |
---|---|
ok | No errors |
invalidAccessKeyError | Invalid AccessKey |
requiredJsonError | The request body requires JSON |
invalidSchemeError | Invalid JSON scheme |
invalidDataError | invalid input data |
prohibitedForAppError | Prohibited for this application |
prohibitedForServiceError | Prohibited for this service |
rpcError | Communication error |
For example:
{
…
“status”: “ok”
....
}
Sending an HLR request
Request:
POST api.unibell.tech/hlr
{
"reference": "123456789",
"msisdn": "7XXXXXXXXXX",
}
Parameter | Type | Description |
---|---|---|
reference | string | The user parameter with which the callback will be called based on the results of the application execution |
msisdn | string | Outgoing 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”,
}
Parameter | Type | Description |
---|---|---|
id | string | Unique identifier |
msisdn | string | Outgoing number |
reference | string | The user parameter with which the callback will be called based on the results of the application execution |
details | string | |
status | string | The status of the HLR message, for the newly created — sent |
createdDateTime | string | Date\time of creation |
statusDateTime | string | Date\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.
Parameter | Type | Description |
---|---|---|
id | string | Unique identifier |
msisdn | string | Outgoing number |
reference | string | The user parameter with which the callback will be called based on the results of the application execution |
details | string | |
status | string | HLR message status: sent — sent, active — number is active, absent — not active, failed — sending error, unknown — unknown |
networkErrCode | string | SS7 errors, see below |
imsi | Subscriber’s IMSI | |
vlr | Subscriber’s VLR | |
hlr | Subscriber’s HLR | |
mcc | MCC Networks | |
mnc | MNC networks | |
ported | Is the subscriber ported to another network | |
createdDateTime | string | Date\time of creation |
statusDateTime | string | Date\time of status receipt |
Error codes in the status
Possible error codes in the status of messages or HLR requests (network Err Code values):
Code | Name | Description |
---|---|---|
0 | No error | The subscriber exists and is available. |
1 | The subscriber does not exist | The specified phone number does not exist. |
6 | The subscriber is offline | The subscriber’s phone is disconnected or is out of range of the network. |
11 | No SMS service | Means 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. |
12 | Error in the subscriber’s phone | The message cannot be delivered to the subscriber due to an error in the telephone or SIM card. |
13 | The subscriber is blocked | Occurs, 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. |
21 | No service support | Service is not supported. |