Modify Objects

Modifies objects of the specified type, this operation is similar to the UPDATE database command. The HTTP method used to send the data is POST.

POST /modify_objects.fcgi

Parameters

  • object (string): Type of object to be modified. See the topic List of Objects to consult the complete list of all types of objects available.
  • values (array of JSON objects): Each element must be a JSON object representing the object to be modified. Each key must be a valid field of the object and the values must have the appropriate type.
  • where (JSON objects) : Please refer to load_objects reference to consult the complete description of the "where" parameter. Only the same object can be used as a filter.

Response

  • changes (int): Number of changes made.

Request example

This request will modify all users named Walter White.

$.ajax({
  url: "/modify_objects.fcgi?session=" + session,
  type: 'POST',
  contentType: 'application/json',
  data: JSON.stringify({
    object: "users",
    values: {name: 'Walter Hartwell White'},
    where: {
      users: {name: 'Walter White'}
    }
  })
});

Response example

{"changes":2}