Cookie

Cookie consent

We use some essential cookies to make this website work. We'd like to set additional cookies to help us measure your experience when you view and interact with the website.

Cookie policy

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

GET https://ws.postcoder.com/pcw/{apikey}/mobile/{mobilephonenumber}

Path parameters

ParameterDescriptionExample
apikeyYour API keyPCW45-12345-12345-1234X
mobilephonenumberThe 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

ParameterDescriptionExample
countrySets 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
formatSets the format of the response, xml or json (default unless "application/xml" header is detected)format=json
identifierSpecifies 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 clientsidentifier=websiteA

Example request and response

GET 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

FieldDescriptionExample
warningAn advisory message about the validation processOnly reduced validation is available for this domain
stateidThe ID of the validation state (see below)1
stateA description of the validation state, which may change from time to time:

-50Number could not be validated.
-6Number is a member of a closed user group such as the emergency services.
-4Device with this number does not support SMS.
-3Number valid but not in use by the destination network.
-2Number is not a mobile number.
-1Number is invalid.
0Number is valid.
1Number is valid and on.
2Number is valid but not on.
Number is valid and on.
onA true or false indicating whether the mobile phone number has connected to the network in last 12 hourstrue
validA true or false indicating whether the mobile phone number is validtrue
numberThe normalised version of mobile phone number00447700900535
typeA description of the type of phone number, which may change from time to time; supported values: MOBILE, FIXED_LINE, UNKNOWNMOBILE
networknameThe name of telephone network providerUK - 02 (UK) Limited
networkcodeThe code of telephone network provider10
countrycodeThe mobile country code234
countrynameThe mobile country nameUnited 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 and on 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.