Number » Lookup

Provides a real time status and validity check & carrier information of a phone number.


Base URL


All requests to TheTexting must be submitted to the base URL. TheTexting provides you with an option of a response as a JSON object, or an XML string - you get to choose which response by selecting the appropriate base URL for your request.


JSON end point

https://www.thetexting.com/rest/sms/json

XML end point

https://www.thetexting.com/rest/sms/xml

HTTP Methods

This API call uses GET method.


Request

All requests require your API credentials (api_key & api_secret), which you can find under "API Settings" in TheTexting Dashboard.

Parameter Description
api_key Required. Your API Key. Ex: api_key=2f0ihf5656lfu03jl
api_secret Required. Your API Secret. Ex: api_secret=cluol3434qwfc0lg
to Required. Number whose details are required.

Response

Following parameters will be returned in the response body.

Parameter Type Detail
Response object
Parameter Type Detail
international_format_number string Provided phone number in international format (E164), for example : "+19142059159"
national_format_number string Provided phone number in local format, for example : "(914) 205-9159"
phone_number_iso2_code string ISO2 country code of the provided number, for example : "US"
phone_number_type string Type of the provided number, for example : "fixed line", "mobile", "voip" etc
mccmnc* string Mobile country code and mobile network code concatenated of the provided number, for example "401223" *Not applicable for US/CA
serving_msc string Serving mobile switching center.
imsi string International Mobile Subscriber Identity, used to uniquely identify the user of a mobile network.
lookup_status string On successful lookup "No Error" will be returned. In case of error, error description will be returned.
original_carrier object
Parameter Type Detail
carrier_name string Name of the carrier provider
carrier_prefix string Carrier prefix
carrier_country_name string Name of the country, provided number belongs to.
carrier_country_prefix string Country prefix
is_ported bool True if number is ported
ported_carrier object
Parameter Type Detail
carrier_name string Name of the carrier provider
carrier_prefix string Carrier prefix
carrier_country_name string Name of the country, provided number belongs to.
carrier_country_prefix string Country prefix
is_roaming bool True if number is in roaming
roaming_carrier object
Parameter Type Detail
carrier_name string Name of the carrier provider
carrier_prefix string Carrier prefix
carrier_country_name string Name of the country, provided number belongs to.
carrier_country_prefix string Country prefix
ErrorMessage string Detailed description of error, if any.
Status int Response code for the query.

Sample Request URL (GET)

https://www.thetexting.com/rest/sms/json/number/lookup?api_key=your_api_Key&api_secret=your_api_secret&to=19142059159

JSON Response (Success)


    {
    "Response": {
    "international_format_number": "+19142059159",
    "national_format_number": "(914) 205-9159",
    "phone_number_iso2_code": "US",
    "phone_number_type": "fixed line",
    "mccmnc": null,
    "serving_msc": null,
    "imsi": null,
    "original_carrier": {
    "carrier_name": "TELENGY L.L.C. - NY",
    "carrier_prefix": null,
    "carrier_country_name": "United States",
    "carrier_country_prefix": null
    },
    "is_ported": null,
    "ported_carrier": null,
    "is_roaming": null,
    "roaming_carrier": null,
    "lookup_status": "No Error"
    },
    "ErrorMessage": "",
    "Status": 0
    }

JSON Response (Failure)


    {
    "Response": null,
    "ErrorMessage": "Lookup Failed. Contact support.",
    "Status": 1
    }

Respond Codes

Code Meaning
0 Request is successful
1 Request has failed. ErrorMessage is returned for detailed description of error.
2 Parameters are missing.
3 Credentials are invalid.
4 Parameters are invalid.
5 Result has returned empty.
6 Status is invalid.