Skip to content

Authentication

When working with Easit GO WebAPI each request to the API is authenticated with an API-key, except PING which does not require authentication. An API-key is provided you by your Easit GO designer or Easit personnel.

API-key vs. User

Behind every API-key is a user connected to it. A user can have one or more API-keys. This user will be displayed as Created by and / or Update by on items when posting updated to items or creating new items in Easit GO. The users access determines what items can be updated and created in and retrieved from Easit GO.

So in short you create a user, give it the access it should have and generate a API-key for that user.

Method

Easit GO WebAPI supports HTTP Basic Authentication with a API-key instead of username + password. Below you can see examples from Postman and SoapUI for how authentication is set up.

Postman

postman_auth

SoapUI

soapui_auth

1
2
3
4
PS C:\Users\me> $pair = "$($Apikey): "
PS C:\Users\me> $encodedCreds = [System.Convert]::ToBase64String([System.Text.Encoding]::ASCII.GetBytes($pair))
PS C:\Users\me> $basicAuthValue = "Basic $encodedCreds"
PS C:\Users\me> $headers = @{SOAPAction = ""; Authorization = $basicAuthValue }
1
2
3
String authenticationString = $"{ApiKey}:";
String base64EncodedAuthenticationString = Convert.ToBase64String(System.Text.ASCIIEncoding.ASCII.GetBytes(authenticationString));
requestMessage.Headers.Authorization = new AuthenticationHeaderValue("Basic", base64EncodedAuthenticationString);
1
2
3
4
String authenticationString = apikey +":";
String base64EncodedAuthenticationString = Base64.getEncoder().encodeToString(authenticationString.getBytes(StandardCharsets.US_ASCII));
String AuthenticationHeaderValue = "Basic " + base64EncodedAuthenticationString;
// Add value to request header