- Products
- Solutions
PUT (POST is also supported)
Endpoint URL: https://api.affiliate-sms.com/hlr/create
Header:
X-API-KEY: live_asdfasdfq234
content-type: multipart/form-data
JSON Body RAW:
{
"msisdn":"380505142320",
"reference":"sendHLR0407",
"tariff":9
"callback_url":"https://somelink.com/hlr
}
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:
Optional:
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"
}
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":"380972920000",
"reference":"extid13423now"
],
"tariff":9,
"callback_url":"http://someurl.com/callback/?id=12345"},
[
{"msisdn":"380972920000",
"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 HLR-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 HLR requests with non-unique (i.e., those that already exist in the system) IDs, error 13 will be returned.
Attention! Upon error 14, HLR requests are not created, even if the payload contained the correctly passed data.