mobile
This endpoint checks whether a mobile phone number is valid and if it's capable of receiving calls and texts. It performs a live test to provide details about the number and network provider but does not initiate a call.
Mobile validation: Enable access on your API key using the Data Options page or by contacting us.
Request URL
GET https://ws.postcoder.com/pcw/{apikey}/mobile/{mobilephonenumber}
Path parameters
Parameter | Description | Example |
---|---|---|
apikey | Your API key | PCW45-12345-12345-1234X |
mobilephonenumber | The URL-encoded mobile phone number you wish to validate | 07500123456 |
Querystring parameters
Parameter | Description | Example |
---|---|---|
format | Sets the format of the response, xml or json (default unless "application/xml" header is detected) | format=json |
identifier | Specifies your own meaningful identifier for the request such as "websiteA" or "client123"; you can view usage for each identifier on the Identifier Usage page, which may be helpful when using your API key across multiple websites, apps or clients | identifier=websiteA |
Example request and response
GET https://ws.postcoder.com/pcw/PCW45-12345-12345-1234X/mobile/07500123456?format=json
{
"warning": "This is a test key do NOT use it live (always returns true)",
"stateid": 0,
"state": "Test Key",
"on": false,
"valid": true,
"number": "",
"type": "UNKNOWN"
}
Response fields
Field | Description | Example |
---|---|---|
warning | An advisory message about the validation process | Only reduced validation is available for this domain |
stateid | The ID of the validation state (see below) | 1 |
state | A description of the validation state, which may change from time to time:
| Number is valid and on. |
on | A true or false indicating whether the mobile phone number has connected to the network in last 12 hours | true |
valid | A true or false indicating whether the mobile phone number is valid | true |
number | The normalised version of mobile phone number | 00447700900535 |
type | Whether the mobile phone number is a mobile number or unknown | MOBILE or UNKNOWN |
networkname | The name of telephone network provider | UK - 02 (UK) Limited |
networkcode | The code of telephone network provider | 10 |
countrycode | The mobile country code | 234 |
countryname | The mobile country name | United Kingdom of Great Britain and Northern Ireland |
Integration advice
- URL encode all special characters (including /) in your request parameters with %xx encoding
- No need to remove spaces, dashes, brackets or other non-numeric characters from the mobile phone number
- When using your API key across multiple websites, apps or clients, set the
identifier
querystring parameter to a meaningful value such as "websiteA" or "client123"; you'll then be able to view these identifiers and the number of requests made by each one on the Identifier Usage page - Requests will usually return within a second but could take up to 5 seconds
- Country defaults to UK if the country code (e.g. +44 or 0044) is not included in the mobile phone number
- Landline phone numbers will always return as invalid
- The
valid
andon
response fields are always returned; treat all other response fields as optional
Credit cost
Each request costs 2 credits.
Buy a credit pack or set up a monthly plan to use with all Postcoder endpoints.