[SalesForce] SOLVED – REST API composite batch fails – INVALID_BATCH_SIZE

I'm trying to use the new batch REST calls as documented here https://developer.salesforce.com/docs/atlas.en-us.api_rest.meta/api_rest/dome_composite_batch.htm#topic-title

But I get the following;

My request body;

{"batchRequests":[
  {"method":"PATCH","url":"v34.0/sobjects/account/001D000000K0fXOIAZ","richInput":{"Name":"NewName"}},
  {"method":"GET","url":"v34.0/sobjects/account/001D000000K0fXOIAZ?fields=Name,BillingPostalCode"}
]}

The Response

[{"errorCode":"INVALID_BATCH_SIZE","message":"No requests found in batch request"}]

This was using services/data/v34.0/composite/batch.

Has anyone got a working example of this please?

Best Answer

Todd,

What you are doing should definitely work. The endpoint you are posting to looks correct, and the payload is in the correct format. I would expect you to receive an error, but the error should be 404s since the account you are using does not exist in your system...not an invalid batch size error.

Would you be able to log a case with support and provide:

  • The specific way you are submitting the request (Workbench, curl, apex, some custom code)
  • Login access granted to your org
  • The org id for the org you are testing on

Once you have done that, respond with the case number and I can take a look on our side.

Thanks in advance. Jay

Related Topic