Batch API not working - throws Bad Request received
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-17-2024 04:39 AM
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.
However, when I send the same request through the BATCH API, I receive the aforementioned error.
Interestingly, when I randomly removed the `sysparm_offset` and other conditions from the GET query, it worked.
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?