Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

Suddenly started to get 400 bad request

EvgeniyG
Tera Contributor

We have a job that uses servicenow REST API to query for events every three minutes. It works fine, until yesterday, when suddenly we started to get 400 Bad Request.

I can't reproduce the issue from the development env POSTMAN, same URL works. What can it be? 
Regards,

Evgeniy

2 REPLIES 2

EvgeniyG
Tera Contributor

Adding here a root cause , in case anyone would meet same problem:

{
    "error": {
        "message": "Pagination not supported",
        "detail": "The requested query is too long to build the response pagination header URLs. Please do one of the following: shorten the sysparm_query, or query without pagination by setting the parameter 'sysparm_suppress_pagination_header' to true, or set 'sysparm_limit' with a value larger then 233 to bypass the need for pagination."
    },
    "status": "failure"

Our query was too long.

EvgeniyG
Tera Contributor

Adding here the root cause: our query was too long, this the message body:

{
"error": {
"message": "Pagination not supported",
"detail": "The requested query is too long to build the response pagination header URLs. Please do one of the following: shorten the sysparm_query, or query without pagination by setting the parameter 'sysparm_suppress_pagination_header' to true, or set 'sysparm_limit' with a value larger then 233 to bypass the need for pagination."
},
"status": "failure"
}