Why HTTP status 400 is shown while using user agent is ServiceNow in REST API?

Community Alums
Not applicable

Hi,

When I tried to submit a form which checks for the serviceability for the user, it basically uses REST API to check the serviceability of the user. 

Lately it was working fine but now it is throwing HTTP Error code as 400.

When I replicate the process in POSTMAN by changing the User-Agent value from Servicenow it works and getting 200. 

From client side, request format is accepted with any user agent but not servicenow or servicenow/2.0.

 

Response: <!doctype html><html lang="en"><head><title>HTTP Status 400 – Bad Request</title><style type="text/css">body {font-family:Tahoma,Arial,sans-serif;} h1, h2, h3, b {color:white;background-color:#525D76;} h1 {font-size:22px;} h2 {font-size:16px;} h3 {font-size:14px;} p {font-size:12px;} a {color:black;} .line {height:1px;background-color:#525D76;border:none;}</style></head><body><h1>HTTP Status 400 – Bad Request</h1></body></html>

 

how to resolve this issue?

 

Thanks,

Abdul

 

1 REPLY 1

sourav1999
Mega Guru

• HTTP status 400 is an error code that indicates a bad request.

• This error is shown when the user agent is ServiceNow in a REST API call.

• This is because the ServiceNow user agent is not a valid user agent in the REST API call.

• To fix this issue, you must replace the ServiceNow user agent with a valid user agent.

 

For asking ServiceNow-related questions try this :

For a better and more optimistic result, please visit this website. It uses a Chat Generative Pre-Trained Transformer ( GPT ) technology for solving ServiceNow-related issues.

Link - https://nowgpt.ai/

 

For the ServiceNow Certified System Administrator exams try this :

https://www.udemy.com/course/servicenow-csa-admin-certification-exam-2023/?couponCode=NOW-DEVELOPER