Skip to main content
Question

REST API with hashed "Accesstoken"

  • November 18, 2025
  • 0 replies
  • 11 views

Forum|alt.badge.img

I need to connect some new REST API's to our TX environment. These API's where easy to configure in Postman, but is now a challenge in TX. In Postman it's possible to use a “pre-script” (java) to create some variables, concatenate them and then hash. 

This is the script:

const method = 'GET';
const urlPath = '/app/openapi/v1/device/deviceOpenIds';
const secret = 'MY_SECRET';
const timestamp = Date.now().toString();

const signature = CryptoJS.HmacSHA256(method + timestamp + urlPath, secret).toString(CryptoJS.enc.Hex);

pm.environment.set('timestamp', timestamp);
pm.environment.set('signature', signature);

This signature is used in the header for authentication for the GET call. The API provider gives a python or java script to make the HmacSHA256 hash, but I cannot use that directly in TX.

What is a good way to approach this in TimeXtender?