Authentication
Overview
All calls to the Autoaddress 3.0 API must be authenticated.
This can be done by passing either an API key or token in a request.
A User-Agent is required in the header to ensure the call is successful.
API Key
Header
An API key can be included in a request header using Basic authentication.
The username is your API key such as pub_xxxxxxxx-xxxx-xxxx-xxxxxxxxxxxx
. The password is left blank.
This results in an Authorization where <credentials>
is pub_xxxxxxxx-xxxx-xxxx-xxxxxxxxxxxx:
Base64 encoded and a header that looks like below:
Authorization: Basic <credentials>
For example, an Autocomplete call can be made using cURL as follows:
curl 'https://api.autoaddress.com/3.0/autocomplete?address=dame' \ --header 'Authorization: Basic <credentials>'
Query String
Alternatively, an API Key can be provided to a request in the query string using the key parameter.
For example, an Autocomplete call can be made using cURL as follows:
curl 'https://api.autoaddress.com/3.0/autocomplete?address=dame&key=<api-key>'
Token
In order to use a token, you will first need to authenticate the session to create a token using the CreateToken endpoint. To call the CreateToken endpoint you will need to pass a valid API Key. Please see the CreateToken documentation for full details.
If your application has a back end server it is recommended that you call createtoken on the server and then pass the token to the client.
Please note that tokens are valid for a limited time only and attempts to use an expired token will result in a HTTP error.
Header
A token can be included in a request header using Bearer authentication.
Authorization: Bearer <token>
For example, an Autocomplete call can be made using cURL as follows:
curl 'https://api.autoaddress.com/3.0/autocomplete?address=dame' \ --header 'Authorization: Bearer <token>'
Query String
Alternatively, a token can be provided to a request in the query string using the key parameter.
For example, an Autocomplete call can be made using cURL as follows:
curl 'https://api.autoaddress.com/3.0/autocomplete?address=dame&token=<token>'