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 Features page or by contacting us.
Request URL
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; the endpoint assumes the country is United Kingdom unless you prefix the mobile phone number with its international dialling code (e.g. +44 or 0044) or set the country querystring parameter (see below) | 07500123456 |
Querystring parameters
Parameter | Description | Example |
---|---|---|
country | Sets the country using the 2-character country code (ISO 3166-1 alpha-2) so that you can supply a mobile phone number without its international dialling code prefix. The specified country will be overriden by the international dialling code if it is supplied at the start of a mobile phone number. The endpoint assumes the country is United Kingdom by default (e.g. country=gb) | country=ie |
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
https://ws.postcoder.com/pcw/PCW45-12345-12345-1234X/mobile/07500123456?format=json
{
"stateid": 1,
"state": "Number is valid and on.",
"on": true,
"valid": true,
"number": "00447500123456",
"type": "MOBILE",
"networkname": "UK - VODAFONE",
"networkcode": "15",
"countrycode": "234",
"countryname": "United Kingdom of Great Britain and Northern Ireland"
}
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 | A description of the type of phone number, which may change from time to time; supported values: MOBILE, FIXED_LINE, UNKNOWN | MOBILE | ||||||||||||||||||
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
- Verify your request was successful by checking for an HTTP status code of 200; see all HTTP status codes with descriptions
- 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
- 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 1.2 credits.
Buy a credit pack or set up a monthly plan to use with all Postcoder endpoints.