Number Formatting - Input

v1 / v2

Number Formatting - Input

Overview

When making your request it is possible to force your telephone number to be formatted into the E164 format (also known as international format) which is necessary for us to use when sending your telephone number to the network operator to obtain a result.

You can include the input_format parameter within your request adding in the 3 letter ISO code for the country that your telephone number belongs to.

This is useful if your stored telephone numbers are stored in their local format as means you don’t have to edit these before making your API request.

The below table details how this works and the result you should expect.

Input Field
input_format

Input Field
telephone_number

Output Field

Reason

<omitted>
<empty>

07790606023


“detected_telephone_number”:
“”,
“telephone_number_type”:
“BAD_FORMAT”…

Telephone number was checked globally and was not a valid telephone number anywhere in the world.

This is because the user provided a local UK telephone number and did not include the country code 44.

“GBR”

  • 07790606023

  • 447790606023

  • 00447790606023

  • 004407790606023

…”detected_telephone_number
“ : “447790606023”,
“telephone_number_type”:
“MOBILE”…

Telephone number was forced into GBR (United Kingdom) format by appending country code 44 if not already present, and fixing local-number formatting.

Number was detected as valid UK mobile telephone.

<omitted>
<empty>

7148307000

…”detected_telephone_number
“ : “”,
“telephone_number_type”:
“BAD_FORMAT”…

Telephone number was checked globally and was not a valid telephone number anywhere in the world.

This is because the user provided a local USA telephone number and did not include the country code 1.

“USA”

  • 7148307000

  • 17148307000

  • 0017148307000

…”detected_telephone_number
“ : “17148307000”,
“telephone_number_type”:
“LANDLINE”…

Telephone number was forced into USA format by appending country code 1 if not already present and fixing local-number formatting.

Number was detected as valid USA landline.

<some unsupported value>

Providing any input_format field which is not a valid ISO3 will cause a HTTP 400 Bad Request

Curl example using the input_format parameter

curl -I -H "Content-Type: application/json" -X POST -d `{"api_key":"your_api_key_here", "api_secret":"your_api_secret_here", "requests":[{"telephone_number": "07790606023", "input_format": "GBR"}]}`

https://api.hlrlookup.com/apiv2/hlr