SMSC HLR API
MessageCloud's SMSC HLR HTTP API allows you to perform high burst HLR Lookups; HLR Lookups.
HTTP HLR refers to the method of sending your [HLR Lookup] using the HTTP GET/POST interface.
The HTTP interface to the MessageCloud SMSC has been tested and benchmarked to 100 tps, for an individual service account, using parallel HTTP requests and measuring the result with jmeter
The default service account configuration, provides 10 concurrent HTTP GET/POST connections. If your service requires a greater throughput, please contact your MessageCloud account manager.
Connecting
Using a single HTTP POST operation, the external application can get HLR related parameters like current IMSI, MCC and MNC, by submitting MSISDN to SMSC platform.
The SMSC is HTTP version 1.1 compliant. All parameters in a POST request should be url-encoded. A HTTP GET Request may also be used, but is of limited use since a GET operation cannot hold more than 255 characters.
Scripts
Scripts for easy HLR Lookup. Choose from our ready-made scripting languages, which offer simple modification and the ability to perform HLR Lookups.
Choose from Java, PHP, C#/.Net, C++/CLI, VB.NET, ASP, RUBY, NodeJS, Python, Curl
View code on our Scripts page
Find these on GitHub
HTTP URL
Example URL:
HTTP Post/Get Parameters
<msisdn>
Msisdn which is need to check HLR parameters.
<username>
Account username.
<password>
Account password
<output>
Format of response. Valid values are “xml” and “json”
Values to include:
Parameter Values
msisdn As required
username As provided
password As provided
output xml or json
REQUEST
Account password
POST
A valid submission format of a message:
POST <post_url> HTTP/1.1 Host: <sms_hub host> Content-Type: application/x-www-form-urlencoded
msisdn=<msisdn>&username=<username>&password=<password>&output=<xml/json>
Example: POST /checkHLR HTTP/1.1 Host: smsc.txtnation.com Content-Length: 63 Content-Type: application/x-www-form-urlencoded
msisdn=4479xxxxxxxx&username=abcdefg&password=*******&output=xml
GET
HTTP GET Request as follows: http://<host>:<port>/<path>?msisdn=<Msisdn>&username=<UserName>&password=<Password>&output=<xml or json>
RESPONSE
The following response is valid for the above request:
Response Code: OK
Content-Length: xx
Content-Type: text/xml
Date: Fri, 03 Oct 2014 18:37:16 GMT
Server: MochiWeb/1.0
<XML/JSON Output>
Return Success with XML output
<hlr result="ok">
<msisdn> </msisdn>
<imsi> </imsi>
<msc> </msc>
<gt> </gt>
<mcc> </mcc>
<mnc> </mnc>
</hlr>
Example:
Response Code: OK
Content-Length: 275
Content-Type: text/xml
Date: Fri, 03 Oct 2014 18:37:16 GMT
Server: MochiWeb/1.0
<hlr result="ok">
<msisdn>4474xxxxxxxx</msisdn>
<imsi>23420xxxxxxxx </imsi>
<msc>44778xxxxxxxx </msc>
<gt>44778xxxxxxxx </gt>
<mcc>234</mcc>
<mnc>20</mnc>
</hlr>
Return Success with JSON output
{
"result":"ok",
"msisdn":"xxxxxxx",
"msc":"xxxxxxx",
"imsi":"xxxxxxx",
“gt”:”xxxxxxxxx”,
"mcc":"xxx",
"mnc":"x"
}
Example:
Response Code: OK
Content-Length: 196
Content-Type: text/plain
Date: Fri, 03 Oct 2014 18:13:20 GMT
Server: MochiWeb/1.0
{"result":"ok","msisdn":"94123xxxxxx","msc":"9412000xxxx","imsi":"51320000028092","gt":"9412000xxxx","mcc":"513","mnc":"2"}
Return Error with XML output
<hlr result ="error">
<error> Error Code </error>
</hlr>
Example:
Response Code: OK
Content-Length: 43
Content-Type: text/xml
Date: Fri, 03 Oct 2014 18:36:59 GMT
Server: MochiWeb/1.0
<hlr result ="error"><error>6</error></hlr>
Return Error with JSON output
{"result":"error","errorcode":Error Code}
Example:
Response Code: OK
Content-Length: 32
Content-Type: text/plain
Date: Fri, 03 Oct 2014 18:38:34 GMT
Server: MochiWeb/1.0
{"result":"error","errorcode":6}
Error | Description |
1 | Unknown Subscriber |
6 | Absent Subscriber SM |
9 | Illegal Subscriber |
11 | Tele Service Not Provisioned |
13 | Call Barred |
14 | Unidentified Subscriber |
21 | Facility Not Supported |
24 | Network Failure |
27 | Absent Subscriber |
30 | SRI Timeout |
31 | TCAP Abort |
34 | System Failure |
35 | Data Missing |
36 | Unexpected Data Value |
100 | HTTP Error |
101 | Invalid Path |
102 | Msisdn Missing |
103 | Username Missing |
104 | Password Missing |
105 | Authentication Failed |
106 | HTTP Server Timeout |
107 | Unknown Response |
108 | SRI Server Timeout |
109 | SRI Server Error |
110 | Charging Failed |
111 | No SRI Provider |
112 | Client not found |
113 | SRI HTTP API not found |
114 | HTTP error in SRI HTTP API |