Required to provide Auth information error in Inbound REST integration

madanm7786
Mega Guru

Hi All,

I am trying to do inbound integration to create incident in SN.

I have given the SN end point to external tool and also i have given username and password.

When the external tool is trying to send response to SN, they are getting error message as below.

{ "error": { "detail": "Required to provide Auth information", "message": "User Not Authenticated" }, "status": "failure" }

Can you please help me here on this.

Thanks,

Maddy

6 REPLIES 6

Ashutosh Munot1
Kilo Patron
Kilo Patron

HI Madan,



Have you selected proper profile and also check if parameters for authentication are proper or not.



Please share screen shot.



Thank you,
Ashutosh


jameswang
Kilo Expert

Madan,


I had similar issue, but I resolved with the following code, which inside business rule from instance 1



try {


var user = 'xxxxxx';     <-- valid username with itil role from instance 2


var password = 'bbbbbb';



var request = new sn_ws.RESTMessageV2();


var rBodyInsert = "{\"u_ssss_number\":\""+current.number+"\",\"u_ssss_id\":\""+current.sys_id+"\",\"comments\":\"** SSSS ticket created:   "+current.number+"\",\"caller_id\":\"fdc59132db4453009498e9525b96197f\",\"short_description\":\""+current.short_description+"\",\"description\":\""+current.description+"\" }";



request.setEndpoint("https://aaaaaaaaaaaaaaaaaa.service-now.com/api/now/table/incident?sysparm_fields=");


request.setHttpMethod('POST');



request.setBasicAuth(user,password);


request.setRequestHeader("Accept","application/json");


request.setRequestHeader('Content-Type','application/json');


request.setRequestBody(rBodyInsert);


var responseInsert = request.execute();



gs.log("WWWWW2: "+current.number+', -- '+responseInsert.getBody());


}


catch(ex) {


var message = ex.getMessage();


gs.log('WWWWW-Error: '+message);


}



Hope it helps!!



James