Authentication
An API key can be created for an issuer, the issuer can have as many keys assigned to them.
This key can only be created through the web interface in Settings → API keys using “Create new key” button. Note that this page is available only when REST API add-on is enabled under Add-ons.
This key can then be used for authentication by combining it with the ID of the key seperating them by a colon, base64 encoding them and then using the result as a Bearer token as can bee seen with the process below.
- Put the values in this format
[KEY_ID]:[KEY_TOKEN]
For example:dde8408f-2c3b-499d-926e-5229b0f6680c:400244844d514ea3a63dbaeb0b517a0b
- Base64 encode that value
- Put the encoded value into the Authorization header like so:
Bearer ZGRlODQwOGYtMmMzYi00OTlkLTkyNmUtNTIyOWIwZjY2ODBjOjQwMDI0NDg0NGQ1MTRlYTNhNjNkYmFlYjBiNTE3YTBi
Errors
The API will always respond with 401 UNAUTHORIZED
if any authentication problems arise.
These problems could be:
- Deactivated API key
- Invalid API token or ID
- Malformed base64 encoding
- Invalid formatting before base64 encoding
- Wrong header name (Not using the
Authorization
header) - Missing
Bearer
prefix