Back& API allows to remove only with an ID. How do I delete multiple rows from a table on Backand by the values of other columns?
I need to remove by other fields of the table, not by ID
Asked
Active
Viewed 180 times
0

Алексей Компанец
- 311
- 1
- 2
- 8
1 Answers
1
To delete multiple rows use the following REST configuration. The headers should contain your Authorization bearer and AppName
url: https://api.backand.com/1/bulk
body: [
{
"method":"DELETE",
"url":"https://api.backand.com/1/objects/YOUR_OBJECT_NAME/OBJECT_ID1"
},
{
"method":"DELETE",
"url":"https://api.backand.com/1/objects/YOUR_OBJECT_NAME/OBJECT_ID2"
}
]
e.g.
[
{
"method":"DELETE",
"url":"https://api.backand.com/1/objects/news/2"
},
{
"method":"DELETE",
"url":"https://api.backand.com/1/objects/news/3"
}
]
headers should look like this
Headers:{"Authorization": Bearer YOUR_ACCESS_TOKEN, "AppName": YOUR_APP_NAME}

user3375230
- 421
- 2
- 5
-
With the SDK its Backand.apiUrl() – user3375230 Apr 12 '16 at 15:41
-
I got it from backand – user3375230 Apr 12 '16 at 15:43
-
I need to remove by other fields of the table, not by ID – Алексей Компанец Apr 14 '16 at 05:46
-
you can delete only by Id, a workaround is to query all these ids and loop the delete call for each or construct the above JSON with these id's, you can do it once in a server side action – user3375230 Apr 17 '16 at 11:05