0

As all of you knows, in postman we can save values in global variables, por e.g. {token} variable in Test tab, with this code below:

var jsonData = JSON.parse(responseBody);
pm.globals.set("token", jsonData.access_token);

So, the backend always will response with something like this:

{
    response: "QsWEeTYfdU-fgIyukOJKlH-iGBgFdsVxcfg... etc"
}

Then, always I need decrypt that string to obtain the real object response:

{
   "data1": "value a",
   "data2": "value b",
   "token": "asSDdHkFgYUjKvLnHvFhSsAAjfAuSAdgFaGkGsa... etc",
}

Then I put the token value in {token} global variable of postman...

But the goal is decrypt automatically before to get token or other action, but always in postman, for test the APIs.

It is posible do this?

Thanks for read.

Hector
  • 636
  • 8
  • 16

0 Answers0