Number » Search

Get available inbound numbers for a given country.


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.


Parameters

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
country_code Required. A two letter country code. Ex: US (for USA)
area_code Optional. A area code within the country specified e.g. 310 (for California)
number Optional. A specific number or 3,4 digits to pattern-match existing numbers

Sample URL

https://www.thetexting.com/rest/sms/json/number/search?api_key=12345&api_secret=123&country_code=us&area_code=330&number=133068072

JSON Response (Success)

{

    "Response": [

        {

            "country_name": "United States",

            "area_code": "330",

            "number": "13306807200",

            "price": 1

        },

        {

            "country_name": "United States",

            "area_code": "330",

            "number": "13306807201",

            "price": 1

        },

        {

            "country_name": "United States",

            "area_code": "330",

            "number": "13306807204",

            "price": 1

        },

        {

            "country_name": "United States",

            "area_code": "330",

            "number": "13306807208",

            "price": 1

        },

        {

            "country_name": "United States",

            "area_code": "330",

            "number": "13306807214",

            "price": 1

        }

    ],

    "ErrorMessage": "",

    "Status": 0

}


XML Response (Success)

<TheTexting xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
<ErrorMessage/>
<Response xmlns:d2p1="http://schemas.datacontract.org/2004/07/RESTwebapi.Models">
<d2p1:USP_SELECT_Number_Result>
<d2p1:area_code>330</d2p1:area_code>
<d2p1:country_name>United States</d2p1:country_name>
<d2p1:number>13306807200</d2p1:number>
<d2p1:price>1.00</d2p1:price>
</d2p1:USP_SELECT_Number_Result>
<d2p1:USP_SELECT_Number_Result>
<d2p1:area_code>330</d2p1:area_code>
<d2p1:country_name>United States</d2p1:country_name>
<d2p1:number>13306807201</d2p1:number>
<d2p1:price>1.00</d2p1:price>
</d2p1:USP_SELECT_Number_Result>
<d2p1:USP_SELECT_Number_Result>
<d2p1:area_code>330</d2p1:area_code>
<d2p1:country_name>United States</d2p1:country_name>
<d2p1:number>13306807204</d2p1:number>
<d2p1:price>1.00</d2p1:price>
</d2p1:USP_SELECT_Number_Result>
<d2p1:USP_SELECT_Number_Result>
<d2p1:area_code>330</d2p1:area_code>
<d2p1:country_name>United States</d2p1:country_name>
<d2p1:number>13306807208</d2p1:number>
<d2p1:price>1.00</d2p1:price>
</d2p1:USP_SELECT_Number_Result>
<d2p1:USP_SELECT_Number_Result>
<d2p1:area_code>330</d2p1:area_code>
<d2p1:country_name>United States</d2p1:country_name>
<d2p1:number>13306807214</d2p1:number>
<d2p1:price>1.00</d2p1:price>
</d2p1:USP_SELECT_Number_Result>
<d2p1:USP_SELECT_Number_Result>
<d2p1:area_code>330</d2p1:area_code>
<d2p1:country_name>United States</d2p1:country_name>
<d2p1:number>13306807215</d2p1:number>
<d2p1:price>1.00</d2p1:price>
</d2p1:USP_SELECT_Number_Result>
</Response>
<Status>0</Status>
</TheTexting>

JSON Response (Failure)

{
"Response": null,
"ErrorMessage": "Parameters Missing",
"Status": 2
}


XML Response (Failure)

<TheTexting xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
<ErrorMessage>Parameters Missing</ErrorMessage>
<Response i:nil="true"/>
<Status>2</Status>
</TheTexting>

Respond Codes

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