From txtNation Wiki
Jump to: navigation, search

txtNation'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 txtNation 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 txtNation account manager.



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 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


Example URL:

Xml http://smsc.txtnation.com:5002/checkHLR?msisdn={INSERT}&username={INSERT}&password={INSERT}*output=xml

Json http://smsc.txtnation.com:5002/checkHLR?msisdn={INSERT}&username={INSERT}&password={INSERT}*output=json

http://< host>:<port>/<path> Descriptions as follows:


HTTP server host


TCP port is


Application path

Values to include:

Parameter Value
Host smsc.txtnation.com
Port 5002
Path checkHLR

HTTP Post/Get Parameters


Msisdn which is need to check HLR parameters.


Account username.


Account password


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


Account password


A valid submission format of a message:

POST <post_url> HTTP/1.1 Host: <sms_hub host> Content-Type: application/x-www-form-urlencoded


Example: POST /checkHLR HTTP/1.1 Host: smsc.txtnation.com Content-Length: 63 Content-Type: application/x-www-form-urlencoded



HTTP GET Request as follows: http://<host>:<port>/<path>?msisdn=<Msisdn>&username=<UserName>&password=<Password>&output=<xml or json>

Example: http://smsc.txtnation.com.com:5002/checkHLR?msisdn=4479xxxxxxxx&username=abcdefg&password=********&output=xml


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>


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">
<imsi>23420xxxxxxxx </imsi>
<msc>44778xxxxxxxx </msc>
<gt>44778xxxxxxxx </gt>

Return Success with JSON output


Response Code: OK
Content-Length: 196
Content-Type: text/plain
Date: Fri, 03 Oct 2014 18:13:20 GMT
Server: MochiWeb/1.0

Return Error with XML output

<hlr result ="error">
<error> Error Code </error>

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}


Response Code: OK
Content-Length: 32
Content-Type: text/plain
Date: Fri, 03 Oct 2014 18:38:34 GMT
Server: MochiWeb/1.0

Error Codes

Error Code Description
1 Unknown Subscriber
6 Absent Subscriber SM
11 Tele Service Not Provisioned
13 Call Barred
21 Facility Not Supported
24 Network Failure
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 Insufficient Credit

Personal tools