Converts a telephone number to its standard format.
The service returns the telephone number formatted according to a number of options as described below. The default combination of these options means that input telephone numbers are treated as UK unless they include a country code, and UK numbers are formatted using national dialling rules (e.g. 0151 355 4555) while all other countries are formatted using international dialling rules (e.g. +1 800 555 1234).
The functionality of this service is included in the PhoneValidation
service. If you need to validate and format a telephone number, you can do both in one API call with that service.
To connect to this service you'll need to use one of these endpoints:
Protocol | URL |
---|---|
JSON |
JSON
https://webservices.data-8.co.uk/TelephoneFormatting/FormatTelephoneNumber.json |
OPEN API |
OPEN API
https://webservices.data-8.co.uk/swagger/TelephoneFormatting/swagger.json |
SOAP |
SOAP
https://webservices.data-8.co.uk/telephoneformatting.asmx |
Name | Description |
---|---|
username | username
See the available authentication methods. If you are using username & password authentication, specify the username to authenticate as. If you are using API Key authentication and you are not using the JSON, Javascript or ADO APIs, use your API Key here with the prefix |
password | password
If you are using username & password authentication, specify the password to use for authentication. Otherwise leave this blank. |
number | number
The telephone number to reformat. |
options | options
An array of options that control further details of how this method operates. See the |
option
parameter. Each option is specified as a key/value pair.
The list of available names is shown below, along with a description of the allowable values for that name.
Name | Description |
---|---|
Common Options | |
ApplicationName |
ApplicationName
Gives the name of the calling application - used to break down usage by application in the usage reports on the dashboard.
|
Service Specific Options | |
DefaultCountryCode | DefaultCountryCode
The country code (without leading + or 00) that telephone numbers are assumed to be from if no country code is included in the input telephone number. |
DefaultFormatType | DefaultFormatType
The format the telephone number should be returned in. This can be one of the following values:
|
DifferentFormatCountries | DifferentFormatCountries
A comma-separated list of country codes (without leading + or 00). Any telephone numbers for these countries will be formatted using the |
DifferentFormatType | DifferentFormatType
The format the telephone number should be returned in if it is from a country listed in |
UseLocalFormatting | UseLocalFormatting
Indicates if telephone numbers should be formatted according to the country-specific rules for its particular country. If this is set to false, numbers are formatted according to ITU international standard formatting. |
Name | Description |
---|---|
Status | Status
Indicates whether the method call was successful, or if some error occurred. If the |
FormattedNumber | FormattedNumber
Contains the formatted version of the supplied number |
Each request to this method consumes 1 TelephoneFormatting credit.
Request Format
{ "number": "0044 151-3554555", "options": { "DefaultCountryCode": 44, "DefaultFormatType": "International", "DifferentFormatCountries": 44, "DifferentFormatType": "National", "UseLocalFormatting": true } }
Response Format
{ "Status": { "Success": true, "CreditsRemaining": 1000 }, "FormattedNumber": "0151 355 4555" }
Depending on your chosen authentication method you will need to modify this request slightly:
API Key
https://webservices.data-8.co.uk/TelephoneFormatting/FormatTelephoneNumber.json?key=your-api-key
and do NOT include the
username
or password
properties in the request JSON document.
Username and Password
https://webservices.data-8.co.uk/TelephoneFormatting/FormatTelephoneNumber.json
and include
username
and password
properties in the request JSON document.Do not use for client-side requests!
JWT Token
https://webservices.data-8.co.uk/TelephoneFormatting/FormatTelephoneNumber.json
Include the JWT token in the request headers as:
Authorization: Bearer your-jwt-token
Parameter | Value |
---|---|
Parameters | |
number | number
|
Common Options | |
ApplicationName |
ApplicationName
|
Service-Specific Options | |
DefaultCountryCode |
DefaultCountryCode |
DefaultFormatType |
DefaultFormatType |
DifferentFormatCountries |
DifferentFormatCountries |
DifferentFormatType |
DifferentFormatType |
UseLocalFormatting |
UseLocalFormatting |
Credits Remaining Today: 5 |