Authenticating with the Voila API

This page helps you set up your headers for sending API requests to Voila.

Last updated 10 months ago

Authenticating with the Voila API

To securely access Voila’s API, you must authenticate each request. There are two supported authentication methods:

  • Voila Headers

  • HTTP Basic authentication

Method 1: Voila Headers

For every API request, include the following headers:

  • api-user: Your Voila API Account Name

  • api-token: Your Voila API token

Example:

api-user: your_username 
api-token: your_token 

This method is straightforward and works with most HTTP clients and tools such as Postman.

Method 2: HTTP Basic Authentication

Alternatively, you can use HTTP Basic authentication. This combines your API username and token into a single header.

  1. Concatenate your API username and token with a colon:

    your_username:your_token 
  2. Encode this string in Base64. For example, if your username is admin and your token is secret, the combined string is:

    admin:secret 

    The Base64-encoded value is:

    YWRtaW46c2VjcmV0 
  3. Add the following header to your request:

    Authorization: Basic YWRtaW46c2VjcmV0 

This method is widely supported and may be required by some HTTP libraries or integration tools.

Tip:

If you use Postman, you can specify the api-user and api-token headers directly, or set up Basic authentication by providing your username and token in the “Authorization” tab.

Note:

Always keep your API credentials secure. Do not share your token publicly or hard-code it in client-side code.