1

Is it possible to save a response to a variable from a schedule request thats run every hour?

I am getting every hour an bearertoken and I want to save it in my variable so I can automatically send a post call.

I created a schedule and used this script in my Tests:

const response = pm.response.json();
console.log(responseBody);
pm.globals.set("BearerTokenMaster", response.access_token); 

It does not save in my .globals.BearerTokenMaster.

My response call would be:

{
    "access_token": "eyJhbGciOiJSUzI1",
    "expires_in": 3600,
    "token_type": "Bearer",
    "scope": "erpservice"
}
dimnnv
  • 678
  • 3
  • 8
  • 21
Suntje
  • 21
  • 3

0 Answers0