The SessionStack REST API uses Basic authentication.
The Basic authentication requires you to provide an “Authorization” header with each request beginning with the word “Basic” followed by an interval then your email and the api token in the form:
email:token (base64 encoded)
Note
Because of the basic authentication method, it is advisable to use the API over https to make sure that nobody will steal your credentials.
The sample code below uses the email and API token from the Introduction section. Please replace them with your own credentials.
var email = "[email protected]";
var apiToken = "d4ee759a2c1d4fa5ab789018f1d4b802";
var headers = {
"Authorization": "Basic " + btoa(email + ":" + apiToken)
};