Create Objects

Create objects of the specified type. This operation is similar to the database INSERT command. The HTTP method used to send the data is POST.

POST /create_objects.fcgi

Parameters

  • object (string) : Type of object to be created. See the topic List of Objects to consult the complete list of available objects.
  • values (array of JSON objects) : Each element must be a JSON object representing the object to be created. Each key must be a valid field of the object, and the values must have the appropriate type. All JSON objects must have the same fields.

Response

  • ids (64-bit integer array): ids of created objects.

Request example

This request will create a user.

$.ajax({
  url: "/create_objects.fcgi?session=" + session,
  type: 'POST',
  contentType: 'application/json',
  data: JSON.stringify({
    object: "users",
    values: [{registration: '0123', name: 'Walter White', password: 'Heisenberg'}]
  })
});

Response example

{"ids":[8]}