Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

Table API in Nintex getting 'User Not Authenticated'

tiguin2798
Tera Guru

Hello, I am hoping someone can assist me with this. I am new to APIs, but have a requirement where we are wanting to create a POST Table API to the incident table from a Nintex workflow. However, we keep receiving the below error.

 

tiguin2798_0-1724769679003.png

I have attached the correct headers to my resource and verified the user is not locked out, it has the 'snc_platform_rest_api_access' role, and the tables are set to allow web services. Below is my resource code. I have updated the admin user and password in my instance, but marked out in the example.

(function process(/*RESTAPIRequest*/ request, /*RESTAPIResponse*/ response) {

    var request = new sn_ws.RESTMessageV2();
request.setEndpoint('https://xxxxxx.service-now.com/api/now/table/incident?sysparm_fields=short_description%2Cimpact%2Curgency%2Ccaller_id%2Ccategory%2Cdescription%2Cassignment_group');
request.setHttpMethod('POST');

//Eg. UserName="admin", Password="admin" for this code sample.
var user = 'xxxxx';
var password = 'xxxxxxx';

request.setBasicAuth(user,password);
request.setRequestHeader("Accept","application/json");
request.setRequestHeader('Content-Type','application/json');request.setRequestBody("{\"short_description\":\"Third Party Access Request (Vendor Name)\",\"impact\":\"3\",\"urgency\":\"3\",\"caller_id\":\"\",\"category\":\"IAM\",\"description\":\"\",\"assignment_group\":\"SN_IAM\"}");
var response = request.execute();
gs.log(response.getBody());

})(request, response);

  
The same values I am using here are working fine when using PowerAutomate. The incident is created with the values we have set in the workflow. I am just unsure why Nintex is rejecting the user. Any assistance is greatly appreciated as we would like to avoid recreating our entire workflow to resolve this issue.

0 REPLIES 0