Postman doesn't accept using variables in the request body due to pre-request authorization script

Describe the bug
I’d like to use variables in the request body but Postman didn’t accept that due to my pre-request authorization script, so I get 401 Unauthorized error.

Any suggestions how can I fix that are very apreciated.

Request headers:


Request body:

  "data": {
    "type": "password_request",
    "attributes": {
      "email_address": "{{}}"

Athorization pre-request script:

var secret = pm.environment.get("AuthorizationSecret");

var body = '';
var hash = '';

if(request.method == 'GET') {
    hash = CryptoJS.HmacSHA256('', secret).toString(CryptoJS.digest);
} else {
    hash = CryptoJS.HmacSHA256(, secret).toString(CryptoJS.digest);

postman.setEnvironmentVariable("AuthorizationSignature", hash);


App information:

  • App Type: Native App
  • Postman Version: 6.1.4
  • OS: macOS High Sierra 10.13.5

@Konstantin.V It appears that you’re trying to access nested properties (api.stage and, which is not currently supported. You’ll have to store the URL and email values as distinct variables, and then access them with the usual {{...}} syntax.

Hey @kunagpal,
yes, of course my URL and email values are stored as variables, this is not the source of my issue.

The problem was related to my pre-request authorization script and this solution helped me to resolve it:

var data ='{{}}', 
1 Like