Delete with the REST API

Hello!

How would I delete all documents in a collection using the REST data API?

Hi Jim,

To delete an object regardless whether it is in a collection or “standalone”, use the following:

DELETE https://api.backendless.com/<version-number>/data/<table-name>/<objectId>

If you want to disassociate an object located in a collection from its “parent” object, you would need to send a PUT request for the parent object WITH the original “__meta” property in the JSON body and all the children which must stay with the object. In other words, you would do the following:

  1. retrieve the parent object with a collection of related objects
  2. make the changes in your app to disassociate a child from parent
  3. save the parent with PUT request and make sure to resubmit the __meta property which you received in (1).

Hope this helps.

Regards,
Mark