API Authentication (PREVIEW)
Note
This authentication method is currently in preview and is subject to breaking changes. It is based on a different request format from the rest of the bronID API.
Overview
The authentication methods in this file support two types of authentication headers: Basic Authentication and API Key Authentication. Both methods extract use the serviceUid and apiKey parameters from the Authorization header of the HTTP request.
Authentication Methods
Basic Authentication
When authenticating using Basic Authentication, the Authorization header value sent with the request should start with the keyword Basic. The credentials should be base64-encoded in the format {{SERVICE_UID}}:{{SECRET_KEY}}.
Example header: Authorization: Basic dXNlcklkOmFwaUtleQ== (where dXNlcklkOmFwaUtleQ== is the base64 encoding of {{SERVICE_UID}}:{{SECRET_KEY}}).
How to setup in Postman:
- when creating a request (e.g. a GET or POST request), click the Authorization tab which is located below the URL field
- select Basic Auth from the Auth type dropdown menu
- enter your serviceUid and secretKey in the Username and Password fields respectively.
- Postman will automatically encode the credentials in the base64 format.
Basic Authentication
# Replace YOUR_SERVICE_UID and YOUR_SECRET_KEY with your credentials
curl --user YOUR_SERVICE_UID:YOUR_SECRET_KEY \
"https://dev.bronid.com/v5/lookup?id=33051775556&country=AUS"
API Key Authentication
When authenticating using API Key Authentication, the Authorization header value sent with the request should start with the keyword ApiKey. The credentials should be in the format {{SERVICE_UID}}:{{SECRET_KEY}}.
Example header: Authorization: ApiKey {{SERVICE_UID}}:{{SECRET_KEY}}
How to setup in Postman:
- when creating a request (e.g. a GET or POST request), click the Authorization tab which is located below the URL field
- select API Key from the Auth type dropdown menu
- in the Key field, enter Authorization (this is a fixed value and represents the header name)
- in the Value field, enter your serviceUid and secretKey along with the ApiKey prefix in the following format: ApiKey {{SERVICE_UID}}:{{SECRET_KEY}}
- select Header from the Add to dropdown menu
API Key Authentication
# Replace YOUR_SERVICE_UID and YOUR_SECRET_KEY with your credentials
curl -H "Authorization: ApiKey YOUR_SERVICE_UID:YOUR_SECRET_KEY" \
"https://dev.bronid.com/v5/lookup?id=33051775556&country=AUS"