wireless solutions for a wired world

Making a Carrier Lookup Request Using HTTP

Overview

The MX Telecom Carrier Lookup service allows the carrier of a given mobile number to be determined.

Contents

Making a Carrier Lookup request using HTTP

The MX Telecom Carrier Lookup Service exposes an HTTP interface allowing applications with internet connectivity to lookup the carrier of a cell number.

A request for a page using the structure shown below is all that is needed for you to lookup the carrier of a mobile number using the MX Telecom Carrier Lookup Service. The endpoints for these HTTP requests are http://lookup.mxtelecom.com/USLookup for HTTP and https://lookup.mxtelecom.com/USLookup for HTTPS (SSL).

Requests should be sent as a HTTP GET or POST using the parameters listed below.

HTTP/1.1 is enabled so, if sending multiple packets, the TCP/IP connection should be kept open between requests.

Parameters for requests

NameDescription
userUsername of the account to use
passPassword
msisdnMSISDN of the mobile phone (eg 12125551234). No leading "+" is required
*noteNote that will be stored in the billing record (maximum 160 characters)
*subaccountSub account that will be stored in the billing record (maximum 10 characters)
*responseSpecifies how the response will be formed, options are 'text' for extended text format or 'xml', the default is 'simple text'

Where * denotes an optional parameter

The following example shows the an HTTP request that is understood by the MX Telecom Carrier Lookup Service:

http://lookup.mxtelecom.com/USLookup?user=myusername&pass=mypassword&msisdn=12125551234

Parsing responses to GET requests

There are three possible response types, 'simple text' - default, 'extended text' and 'xml'.

In each case the responses to GET requests take into account standard internet three digit reply codes: broadly speaking, 20x implies success, 40x implies bad request, and 50x implies server errors.

When a request is successfully received by the MX Telecom Carrier Lookup Service a HTTP success will be returned to the caller (200 code) and the HTTP body will contain the result of the lookup request.

In the case of a bad request - eg parameters missing/invalid the servlet will return a Bad request or forbidden error (code 40x).

If there is a problem with the MX Telecom Carrier Lookup Service then a 500 Internal server error will be returned. The customer should wait a few seconds and reattempt their lookup.

Parsing simple text response (default response)

The meaning of the response received is:

ValueDescription
<network>Carrier that the mobile number belongs to. See Carrier Codes for possible values.
UNKNOWNUnrecognised carrier. Please contact us to extend coverage.
FAILURELookup Failed

Extended response types

Both 'extended text' and 'xml' response types contain the same information:

On a successful lookup the following parameters will be returned (*'d parameters are returned where appropriate).

NameDescription
msisdnThe MSISDN that the response relates to
networkThe carrier of the MSISDN, is the same as the carrier value described in the simple text response
network_codeThe OCN code for the carrier
certaintyThe type of lookup that was conducted
*mvnoThe name of the mobile virtual network associated with the handset. Note that in some cases this information will not always be available (e.g. if the handset has been turned off for a number of days). As such the lack of an mvno parameter does not necessarily indicate that the number is not associated with a mvno.

Where the following table contains explanations of certainty codes

Certainty ValueDescription
0Failure
1Prefix Lookup
2Cached Data
3Recently Cached Data
4Known Data

If a lookup has failed the following parameters will be returned

NameDescription
msisdnThe MSISDN that the response relates to
errorA description of the error

Examples of 'extended text' response

Success:

msisdn: 15073800239
network: VIRGIN
network_code: 06939
certainty: 4

Failure:

msisdn: 15073800239
error: Authentication Error

Examples of 'xml' response

Success:


<?xml version="1.0"?>
<response>
        <msisdn>15073800239</msisdn>
        <network>VIRGIN</network>
        <network_code>06939</network_code>
        <certainty>4</certainty>
</response>

Failure:

<?xml version="1.0"?>
<response>
        <msisdn>15073800239</msisdn>
        <error>
                <message>Authentication Error</message>
        </error>
</response>


About MX Telecom

MX Telecom is a leader in wireless technology. MX Telecom offers an easily accessible gateway to data, voice and video messaging services including 2-way and premium SMS, multimedia messaging, interactive voice response, location-based services, video short codes, Internet and TV related solutions.

For more information, MX Telecom can be reached on 1-877-MXTELECOM (+1 877 698 3532), or via email at sales@mxtelecom.com.