Skip to content

Updating Multiple Objects

This API updates multiple objects in a data table with a single request. Consider the following example, it demonstrates an API call which updates all objects in the Person data table where the value of the property age is greater than 20. As a result of the request, all updated objects will have the contactType property set to "personal":

curl -X PUT \  
  -H 'Content-Type:application/json' \  
  -d '{ "contactType":"personal" }' \  
'https://api.backendless.com/application-id/REST-api-key/data/bulk/Person?where=age%20%3E%2010'

Method

PUT

URL

https://api.backendless.com/<application-id>/<REST-api-key>/data/bulk/<table-name>?where=<where clause>

where:

Argument                Description
<application-id> the ID of your application generated upon its creation. You can obtainthe value in the Manage > App Settings section of the Backendless Console.
<REST-api-key> REST API key of your application. You can obtainthe value in the Manage > App Settings section of the Backendless Console.
<table-name> name of the table where the objects need to be updated.
<where clause> a condition for selecting the objects in the targeted table for the bulk update. Must be a URL-encoded value.

Request Headers

Content-Type:application/json  
user-token: value-of-the-user-token-header-from-login

where:

Argument                Description
Content-Type Must be set to application/json. This header is mandatory.
user-token Optional header. Contains a value returned by Backendless in a preceding user Login API call. The operation will be executed with the security policy associated with the currently logged in user. This means all permissions associated with the user and the roles assigned to the user will be enforced by Backendless.

Request Body

A JSON object containing the changes which will be applied to all objects which match the <where clause> condition in the URL.

Response Body

The API returns the number object of objects updated as a result of the request.