Batch API not working - throws Bad Request received

clifford02
Tera Contributor

Referencing the Service documentation on BATCH API, despite setting all the required parameters and ensuring each `service_request` has a unique service ID, I am encountering the following error:

 

 

 

 

{
"error": {
"message": "Bad Request received",
"detail": "The provided BatchRESTRequest was not formatted correctly"
},
"status": "failure"
}

 

 

 

 

I verified the same request by calling it directly with the correct headers and parameters, and I received the expected response, as shown in the screenshot below.

Screenshot 2024-07-17 at 3.44.18 PM.png

However, when I send the same request through the BATCH API, I receive the aforementioned error.

Screenshot 2024-07-17 at 3.44.56 PM.png

Interestingly, when I randomly removed the `sysparm_offset` and other conditions from the GET query, it worked.

Screenshot 2024-07-17 at 3.44.35 PM.png

According to the documentation, any number of GET or POST requests can be combined in a single batch call, with the `sysparm_limit` set to 10,000 max. For my use case, pagination is required to retrieve all the data, but I am currently unable to use that query parameter.

 

Could someone guide me on what I might be doing wrong?

@risanchez @sppatel Do you have any solution for this?

0 REPLIES 0