The CreatorCon Call for Content is officially open! Get started here.

REST Call is being generated through Postman but not in Servicenow Workflow Script

Kunal1995
Tera Contributor

Its a integration with third party which is working through postman but not when i execute the script through workflow , its returning 401 status code.

 

Sytnax in REST Message Content"-

 


{
 
    "requestId""RITM Number",
      
    "callbackUrl""urlofcallback",
    "consumerKeyword":"SIAA",
 
    "users": [
 
        {
            
              
            "legal_first_name""kunal",
 
            "legal_last_name""kumar",
 
            "identity_type""S",
 
            
 
            "operational_manager""mymanager"
 
        }
 
    ]
 
}

and below is the sytax of script in workflow:-
var shared = new sn_ws.RESTMessageV2('Integration', 'MethodName');
        shared.setStringParameterNoEscape('authToken', authToken);
        shared.setStringParameterNoEscape('requestId', requestId);
        shared.setStringParameterNoEscape('legal_first_name', first_name);
        shared.setStringParameterNoEscape('legal_last_name', last_name);
        shared.setStringParameterNoEscape('operational_manager', op521);
        shared.setStringParameterNoEscape('identity_type', identity_type);
        shared.setStringParameterNoEscape('identity_subType', identity_subtype);
        shared.setStringParameterNoEscape('consumerkeyword', consumerKeyword);

Kindly help as i am getting success code through postman.
1 REPLY 1

Kunal1995
Tera Contributor

The auth token is being passed in http header of method