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.

Getting issue with REST API Integration

skazeez0319
Giga Contributor

HI Team, 

I am getting an issue populating the an error like:

{"error":{"message":"User is not authenticated","detail":"Required to provide Auth information"},"status":"failure"}

I have provided the the auth with current credentials only still I am getting issue here, can Some one address this issue?

I am  trying to integrate with UI:
I am writing code like this:
URL:  http://dev339837.service-now.com/api/now/table/incident

const FetchingDeatils =async () => {
  try {
    const res = await fetch(url, {
      method: 'GET',
      headers: {
        'Accept': "application/json",
        'Authorization': "Basic YWRtaW46QXplZXpAMzE5"
      }
    });
    const text = await res.text();
    console.log("Getting the Job : " ,text);
  } catch (err) {
    console.error('Request failed:', err);
  }
 }



It's help full some once can address this issue here.

Thanks,
Azeez.



  

1 REPLY 1

Ankur Bawiskar
Tera Patron
Tera Patron

@skazeez0319 

credentials are correct?

-> use https and not http

-> if your API user is for integration and SSO is enabled in your instance ensure this checkbox is true so that SSO is bypassed

AnkurBawiskar_0-1765296219827.png

 

💡 If my response helped, please mark it as correct and close the thread 🔒— this helps future readers find the solution faster! 🙏

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader