Create a tree element
|
POST /api/v1/billing/tree |
The platform has one tree type: a tree of groups (locations). Cameras and access control devices are placed in its leaf groups.
When creating elements, a custom key can be specified to reference the element. These keys must be unique within the tree.
When creating a child element, either the id from the database or the custom key specified at creation can be provided.
A tree element cannot contain both child elements and leaf objects.
After a root tree element is created, it becomes available to administrators who have permission to synchronize root tree elements with a user: – permission groups-root-sync.
{
"name": "new name",
"type": "cameras",
"external_id": null,
"parent_external_id": null,
"parent_id": null,
"is_last": true,
"latitude": null,
"longitude": null,
"log_extra": {
"some": "information"
}
}
Method parameters
string name, Tree element name
string type, Tree type, always `cameras`. The legacy value `intercoms` is accepted for backward compatibility and creates the same group
string|int external_id, Custom key for the tree element
int parent_id, Required to create a child element using the database ID
string|int parent_external_id, Required to create a child element using its unique key
bool is_last, Create a leaf group to which objects can be added
double latitude, Location latitude, -90 to 90. Must be provided together with `longitude`
double longitude, Location longitude, -180 to 180. Must be provided together with `latitude`
string|array log_extra, Additional information received from an external system
|
201 |
|
Successful response JSON
|
|
422 |
|
Returns a JSON error object. For more information, see General information > Validation. JSON
|