ServiceNow Rest API throwing error (401 UNAUTHORIZED)

ANEEF
Kilo Explorer

Hello Experts 

As part of automatic Incident creating in SNOW I am consuming the API 

https://XXXXXX.service-now.com/api/now/table/incident from windows .net

The response i am receiving as below.

{StatusCode: 401, ReasonPhrase: 'Unauthorized', Version: 1.1, Content: System.Net.Http.StreamContent, Headers:
{
Pragma: no-store
Pragma: no-cache
Transfer-Encoding: chunked
X-Cnection: close
Cache-Control: no-cache,no-store,must-revalidate,max-age=-1
Date: Thu, 20 Feb 2020 06:48:18 GMT
Set-Cookie: JSESSIONID=A6E2DA9ACD623546864F6F8AE8D902CC; Path=/; HttpOnly; SameSite=None; Secure
Set-Cookie: BIGipServerpool_XXXenterprises=xxxxx.XXXX.0000; path=/; Httponly; Secure; SameSite=None; Secure
Server: ServiceNow
WWW-Authenticate: BASIC realm="Service-now"
Strict-Transport-Security: max-age=63072000; includeSubDomains
Connection: close
Content-Type: application/json; charset=UTF-8
Expires: 0
}}

For logging into our ServiceNow I am using office 365 AD and Two Factor authentication(Mobile OTP).

Any help on this matter is much appreciated.

Thanks

 

1 ACCEPTED SOLUTION

Lord Omicron
Giga Expert

This question should be posted to the Now Platform forum. Security Operations is a suite of applications. It is not about securing your ServiceNow instance or authentication issues on the platform. 

That said, you need to look at the user account and role being used to connect to the table from the API.  

View solution in original post

2 REPLIES 2

Lord Omicron
Giga Expert

This question should be posted to the Now Platform forum. Security Operations is a suite of applications. It is not about securing your ServiceNow instance or authentication issues on the platform. 

That said, you need to look at the user account and role being used to connect to the table from the API.  

Hi @Lord Omicron,

 

I have the same issue while i use this over python. can you redirect me to the actual solution for this.