πŸ”“Authorization

This page describes how to authenticate your requests to Groups API

The constructed Authorization token has to be added to every requests' header like so: -H 'Authorization: Bearer <AUTH_TOKEN>' .

If you are using any of the SDKs, construction of the AUTH_TOKEN will be handled by it. You just need to supply the ACCESS_KEY and SECRET_KEY.

To construct your token, you should have your ACCESS_KEY and SECRET_KEY ready. The format accepted by Groups is like the following:

Bearer ACCESS_KEY|SHA256(ACCESS_KEY|SECRET_KEY)

An example of the construction of the token is below:

// Get the access and secret from environment variables
const access = pm.variables.get("x2-access-key");
const secret = pm.variables.get("x2-secret-key");

// Combine them into a single string with '|'
const str = access + '|' + secret;

// Compute the SHA256 hash of the combined string
const hash = CryptoJS.SHA256(str).toString(CryptoJS.enc.Hex);

// Set the Authorization header with 'Bearer {hash}'
request.headers.set({ key: 'Authorization', value: 'Bearer ' + access + '|' + hash });

All of these data can be collected from your environment variables as well. Just suffix each variable with PERCULUS_ , and SDKs will try to collect those information.

Last updated

Was this helpful?