Interested in a ServiceNow event built for developers? Registration for now[dev]26 is officially open!

ServiceNow Table API returns 401 "User is not authenticated" with Basic Authentication

alexkrishna
Kilo Explorer

Hi everyone,
I am currently troubleshooting an authentication issue when trying to create a ServiceNow CSM Case through the REST API.

Environment

  • ServiceNow module: Customer Service Management (CSM)
  • Case table: sn_customerservice_case
  • Voice/telephony integration: ServiceNow Voice / CCI with Amazon Connect
  • ServiceNow instance: <instance>.service-now.com
  • Integration method: AWS Lambda calling the ServiceNow REST API

Issue

We are trying to create a CSM Case directly through the Table API, independently of the Interaction/CCI flow.

Endpoint:

POST https://<instance>.service-now.com/api/now/table/sn_customerservice_case

We tested using Basic Authentication:

Authorization: Basic <base64(username:password)>

However, the request consistently returns:

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

We tested the same request independently using curl, outside of AWS Lambda, and received the exact same 401 response.

Because the failure occurs identically outside Lambda, we believe the issue is likely related to the ServiceNow authentication/security configuration rather than the Lambda implementation itself.

Any guidance on the specific ServiceNow configuration to check would be greatly appreciated.

Thanks!

 

2 ACCEPTED SOLUTIONS

Tanushree Maiti
Tera Patron

Hi @alexkrishna 

 

Did you check the documentation on case API

https://developer.servicenow.com/dev.do#!/reference/api/australia/rest/case-api

https://www.servicenow.com/docs/r/api-reference/rest-apis/case-api.html

 

 

Please Accept the solution if it assisted you with your question & Mark this response as Helpful.
Regards
Tanushree Maiti
ServiceNow Technical Architect
LinkedIn: https://www.linkedin.com/in/tanushreemaiti

View solution in original post

yashkamde
Giga Sage

Hello @alexkrishna ,

 

plz make ensure that you have properly configured basic auth profile in sys_auth_profile_basic table :

yashkamde_0-1789980626264.png

 

yashkamde_1-1789980626273.png

 

 

I have tested in my instance and working proper with basic auth :

yashkamde_2-1789980626244.png

 

If my response helped mark as helpful and accept the solution.

View solution in original post

2 REPLIES 2

Tanushree Maiti
Tera Patron

Hi @alexkrishna 

 

Did you check the documentation on case API

https://developer.servicenow.com/dev.do#!/reference/api/australia/rest/case-api

https://www.servicenow.com/docs/r/api-reference/rest-apis/case-api.html

 

 

Please Accept the solution if it assisted you with your question & Mark this response as Helpful.
Regards
Tanushree Maiti
ServiceNow Technical Architect
LinkedIn: https://www.linkedin.com/in/tanushreemaiti

yashkamde
Giga Sage

Hello @alexkrishna ,

 

plz make ensure that you have properly configured basic auth profile in sys_auth_profile_basic table :

yashkamde_0-1789980626264.png

 

yashkamde_1-1789980626273.png

 

 

I have tested in my instance and working proper with basic auth :

yashkamde_2-1789980626244.png

 

If my response helped mark as helpful and accept the solution.