Skip to main content

Authentification


Foreword

An API Key can be created by your onboard administrator in the settings. The administrator can define the scope of permissions of your API Key, to restrict the data you can access.

An API KEY should look like this: CXX3VVA92XsAxEFD0XQ2FY3WhEErpLbe

The API key has to be included in all API requests to the server in the http header, which should look like this:

{
"Accept": "application/json",
"Content-Type": "application/json",
"API-KEY": "CXX3VVA92XsAxEFD0XQ2FY3WhEErpLbe",
}

You can find more information in the Help Center.

Examples

You can authenticate to our API by passing your API Key in the header, here are a few possibilities.

// Create a new XMLHttpRequest object
const xhr = new XMLHttpRequest();

// Open a new request
xhr.open("GET", "https://your-subdomain.onboard.org/services/api/v1/employees", true);

// Set the request headers
xhr.setRequestHeader("API-KEY", "CXX3VVA92XsAxEFD0XQ2FY3WhEErpLbe");
xhr.setRequestHeader("Content-Type", "application/json");
xhr.setRequestHeader("Accept", "application/json");

// Define what happens on successful response
xhr.onload = function () {
if (xhr.status >= 200 && xhr.status < 300) {
console.log("Response received:", JSON.parse(xhr.responseText));
} else {
console.error("Request failed with status:", xhr.status, xhr.statusText);
}
};

// Send the request
xhr.send();