Breadcrumbs

Create a private folder

The method and parameters

POST  /api/v1/billing/tree/folders/private

Private folders can only be created for camera trees. They are needed to differentiate access to cameras within a single tree element.

Folders can only be created in the final (leaf) element of the tree. The key for a folder must be unique within a single final element of the tree.

JSON
{
    "key": "random_key",
    "external_id": "external_id_of_tree_element",
    "id": null,
    "is_editable": false,
    "log_extra": {
        "some": "information"
    }
}

string key – a key to the folder, which can be sent instead of an ID when creating a camera if you need to add a camera to the folder.


string|int external_id  required – a key for the tree element in which the folder should be created.


int id  required – the ID of the tree element in which the folder should be created.


string|array log_extra – additional information received from an external system.


boolean is_editable – the parameter responsible for the ability to edit and delete a folder (the optional parameter. If not specified, then the default false is used).

201  Created

Successful response

JSON
{
    "id": 15,
    "key": "random_key"
}

422  Unprocessable Entity

Returns a JSON object with an error. For details, see General information > Validation.

JSON
{
    "message": "No error message here",
    "errors": {
        "any_key": [
            "Error details"
        ]
    }
}
cURL
Bash
curl -k --request POST \
	--url 'https://your-domain/api/v1/billing/tree/folders/private' \
	--header 'Content-Type: application/json' \
	--header 'Accept: application/json' \
	--data '{
    "key": "string",
    "external_id": "string|int",
    "id": 0,
    "log_extra": "string|array",
    "is_editable": "boolean"
}'
PHP
PHP
$data = array (
  'key' => 'string',
  'external_id' => 'string|int',
  'id' => 0,
  'log_extra' => 'string|array',
  'is_editable' => 'boolean',
);
$context = stream_context_create([
	'ssl'=>['verify_peer' => false],
	'http' => [
		'method' => 'POST',
		'header' => "Content-Type: application/json\r
Accept: application/json",
		'content'=>json_encode($data)
	]
]);
$result = file_get_contents('https://your-domain/api/v1/billing/tree/folders/private', false, $context);