Batch API access and authentication

Website personalisation

All connections to the Batch API must be authenticated using keys and secrets (basic authentication) and properly formatted requests.

📘

Note

Ometria only supports requests made using SSL (version 1.2 or higher).

Basic authentication

The Batch API limits access via basic authentication.

To manage the basic authentication, log into Ometria and go to: Website Personalisation > Administration >Settings > Admin API Access:

Create an API key and secret combination for the API

To enable basic authentication, navigate to: Website Personalisation > Administration >Settings > Admin API Access

Select + Add API Key:

In the Create New Api Key screen enter a descriptive name and click Create:

Request headers

If you've selected Basic Authentication then you will need to construct a header as described below.

Add authentication credentials to the header as follows:

  1. Combine your username (API Key) and password (API Secret) with a single colon (:).
  2. Base64 encode the combined string.
  3. Prepend "Basic" and a space to the result.

Example:

const key       = "f4198aa7934b402981179610e71dcdbe";
const secret    = "AW328UXvlwqfsOkS8smjIGtxfXAqjJxD";
const encoded   = btoa(`${key}:${secret}`);

// encoded output ZjQxOThhYTc5MzRiNDAyOTgxMTc5NjEwZTcxZGNkYmU6QVczMjhVWHZsd3Fmc09rUzhzbWpJR3R4ZlhBcWpKeEQ=