πAuthorization
This page describes how to authenticate your requests to Groups API
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 });
Last updated
Was this helpful?