HTTP Post formatting - JSON / Form Encoded
Overview
We can accept your request using either the JSON or Form Encoding Content Types.
The preferred request format when calling the hlrlookup.com API is JSON. Optionally instead you can use form encoded, however only 1 telephone number is supported per form request.
Use the following examples to make your requests using either JSON or Form Encoding.
JSON
HTTP Headers:
Content-Type: application/json
ReferenceID: optional - your own reference id.
AccountID: optional - your own account reference id.
You have the option of including your own ReferenceID and AccountID for each request.
If included this information will be stored in our Database.
We can refer back to your requests using specific ID's if required. Unfortunately this information is currently not available on your dashboard stats but we are working on it.
Example requests:
Single telephone number lookup without additional parameters:
{
"api_key": "your_api_key_here",
"api_secret": "your_api_secret_here",
"requests": [
{
"telephone_number": "447540822872"
}
]
}
Single telephone number lookup with additional parameters:
{
"api_key": "your_api_key_here",
"api_secret": "your_api_secret_here",
"requests": [
{
"telephone_number": "447540822872",
"cache_days_private": 30
}
]
}
Multiple number lookups at the same time, with some optional parameters:
{
"api_key": "your_api_key_here",
"api_secret": "your_api_secret_here",
"requests": [
{ "telephone_number": "447540822872" },
{ "telephone_number": "447790606023" },
{ "telephone_number": "447000123456", "output_format": "GBR" },
{
"telephone_number": "071111123456",
"cache_days_private": 8,
"output_format": "NATIONAL",
"save_to_cache": "YES",
"input_format": "GBR"
}
]
}
Form Encoded
HTTP Headers:
Content-Type: application/json
ReferenceID: optional - your own reference id.
AccountID: optional - your own account reference id.
Example requests:
Single telephone number lookup without additional parameters:
api_key=your_api_key_here&api_secret=your_api_secret_here&telephone_number=447540822872
Single telephone number lookup with additional parameters:
api_key=your_api_key_here&api_secret=your_api_secret_here&telephone_number=447540822872&cache_days_private=8&output_format=PLUS_E164&save_to_cache=YES
Note - Multiple number lookups at the same time are not supported with form-encoded requests.