latestSwagger 2.02026-08-172560124.6 KB

6863a5956792

validations

Validate phone number

This endpoint validates a phone number. If optional 2-letter country code country is not specified, the phoneNumber should be formatted according to E164, which means it is expected to be in the international format with a leading "+" and no spaces or dashes, e.g. +4930120765890. Otherwise it may have leading zero instead of country code, e.g. 030120765890.

The endpoint will return a status HTTP 200 which means the phoneNumber is successfully validated. The endpoint will return a status HTTP 400 which means the phoneNumber is missing or invalid.

Example curl:

curl https://{host}/v{X}/validations/phone-numbers?phoneNumber=030120765890&country=IT

Example response:

{
  "errorMessage": "phoneNumber is invalid: 030120765890, country specified is: IT",
  "errorType": "PHONE_NUMBER_INVALID"
}
get/v1/validations/phone-numbers

Query parameters

phoneNumberstring required

Phone number

countrystring

Country code

Response

Phone number validated successfully