Rest API returns error 400

kingstan
Kilo Expert

Hello Team && @Ankur Bawiskar  .,

We face a problem on restAPI.

Suddenly the request from application XYZ to ServiceNow API in lower environment return error400 bad request.

But via postman i get 200 OK result.

Operation:

HTTP GET https://<InstanceURL>/api/now/table/sys_user?sysparam_query=user_name%ABCDEF

Is there anyway to trace the request so that we can see what is causing the error?

Many thanks.,

Kingstan.

1 ACCEPTED SOLUTION

kingstan
Kilo Expert

@Ankur Bawiskar  && @Gauthamraj : Many thanks for your replies.

The issue is found to be at the Java header of the Client's code by which they try to connect with the ServiceNow Instance. The header having authenticator two times. Since there is some chances done at handshake in MiddleWare side, two authenticator causing some issue for the connection. Thus the bad request.

Sharing this info (withOut sensitive data, ofcourse!) for our use in future someone might get such scenario.

Many thanks again for all your time and knowledge/experience sharing.

 

View solution in original post

19 REPLIES 19

Ankur Bawiskar
Tera Patron
Tera Patron

Hi,

Did you compare how 3rd party is sending the details in lower environment.

Please get into a meeting with them and compare.

Regards
Ankur

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

Thanks for the reply again., @Ankur Bawiskar 

I can find no trace of logs (at) system logs >> node log file browser (AND) system logs >> transaction. 

i can find only postman entry at the logs and not the acutal application (XYZ) that is trying to get touch with the testInstance.

So did you compare the request from postman and the request sent by 3rd party.

Did you connect with the 3rd party team to check on this

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

Indeed., postman check is way good for 200 OK.

But the request coming from the 3rd party app via their javaCode wont even reaching the instance to get log traced.

Is it anything related to firewall issue, perhaps?

--OR-- how the connectivity test can be done from 3rd party app --to-- servicenow instance??