Is such a thing possible? Did the people who designed REST just think they would delete things one at a time forever?
So let's say I have 10 Foo's ID 1-10
I want to delete ID's 3, 6, and 9 with a single HTTP DELETE call.
Is there any I can do this without offending the Pope?
Use the sObject Rows resource to delete records. Specify the record ID and use the DELETE method of the resource to delete a record.
We don't support the Request body with the DELETE method. It does allow you to pass HTTP Query Parameters.
Most APIs I'm familiar with don't allow deleting of multiple entities at a time but to perform other operations on multiple entities with URL parameters like ?id=3,6,9
or ? id=3&id=6&id=9
. So it would be fairly common to do either of the following:
DELETE /foos?id=3,6,9
or
DELETE /foos?id=3&id=6&id=9
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With