FormatTelephoneNumber
Converts a telephone number to its standard format
To connect to this service you'll need to use one of these endpoints:
Description
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.
Parameters
The following parameters can be supplied to this method
username |
username apikey- , e.g.
apikey-ABCD-1234-EFGH-5678
|
---|---|
password |
password |
number | number The telephone number to reformat |
options | options |
Advanced Options
The following options can be specified as part of 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.
Common Options | |
---|---|
Name | Description |
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 | |
Name | Description |
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. |
Results
This method returns an object containing the following fields:
Status |
Status Success field is true , the other results described below can be used to get the results of the method.
If Success is false , some error occurred in calling the method, such as the authentication failed or the
account is out of credits. The details of the error can be obtained from the ErrorMessage field, and any other results should be ignored
|
---|---|
FormattedNumber | FormattedNumber Contains the formatted version of the supplied number |