I am getting 401 error for an REST API Message call in workflow (Classic) the REST API is OAuth 2.0

raghavendra_rao
Tera Contributor

Hello Team, 

I have an API from IVM where Auth Type is OAuth 2.0 . This completely works fine in DEV & TEST env.
Where as in PROD i get 401 error on calling the API in workflow classic
Checks done :
1.)OAuth profile client secret & PWD is manually typed and manually created in PROD and its exactly same in DEV & TEST
2.)Under Rest Message Get OAuth Token is Successfull and the HTTP header test is giving the required response and code is 200

3.)Calling that API from background scripts is working as expected and getting required output

4.)RITM Workflow context started is by the requestor ID both in DEV and TEST as well

I am totally confused if its working in REST Message test & on Background script in PROD why not in workflow editor(Classic) i feel its vierd

var r = new sn_ws.RESTMessageV2('IVM_Vending_Machine_API', 'Fetch_Inventory_ByMachine');
 r.setStringParameterNoEscape('machineID', '2816');
var response = r.execute();
var responseBody = response.getBody();
var httpStatus = response.getStatusCode();

The script used is above