getting 401 error while using resp api for servicenow bidirectional integration

mohammadtaneem
Tera Contributor

Hii 

i am working on a servicenow to servicenow integration i have created a rest message and given endpoint of another instance 

i have created a basic auth by giving a user credentials who has all roles which are needed for integration 

i have created post method in post method when i test it i am getting 401 error but getting 200 status in the default get method  i am confused where i went wrong help me regarding this 

1 REPLY 1

vaishali231
Mega Sage

Hey @mohammadtaneem 

The 401 Unauthorized error indicates an authentication issue with the target instance.

I would suggest checking the following:

  1. Verify that the Basic Auth Profile contains the correct username and password of a user from the target instance.
  2. Ensure that the target user account is active and not locked out.
  3. Since your POST method uses Inherit from parent, verify that Basic Authentication is correctly configured on the parent REST Message.
  4. Check the HTTP Request tab and add the following headers:

               Accept: application/json

              Content-Type: application/json
     5. Check the outbound HTTP request logs to verify whether the Authorization header is being sent.

*************************************************************************************************************************************

If this response helps, please mark it as Accept as Solution and Helpful.

Doing so helps others in the community and encourages me to keep contributing.

Regards

Vaishali Singh
Linkedin - https://www.linkedin.com/in/vaishali-singh-2273361bb