26.09 26.06 26.05 25.12
26.09 26.06 26.05 25.12 Russian English

Get platform tree

Get the platform tree

GET  /api/v1/billing/tree

By default, a tree request returns root elements. To retrieve child elements, provide the identifier of the element whose children should be returned.

The identifier can be id or external_id.

Method parameters

string type, Optional: there is only one tree. If provided, accepts `cameras` and the legacy value `intercoms`


int id, ID of the tree element whose children should be returned


string|int external_id, Custom key of the tree element whose children should be returned

200  OK

Successful response

JSON
[
    {
        "id": 1,
        "name": "Name of item 1",
        "external_id": "unique_key_1",
        "has_items": false,
        "has_child": true
    },
    {
        "id": 2,
        "name": "Name of item 2",
        "external_id": "unique_key_2",
        "has_items": true,
        "has_child": true
    },
    {
        "id": 3,
        "name": "Name of item 3",
        "external_id": "unique_key_3",
        "has_items": false,
        "has_child": true
    }
]

422  Unprocessable Entity

Returns a JSON error object.

For more information, see General information > Validation.

JSON
{
    "message": "No informative message is provided here",
    "errors": {
        "any_key": [
            "The reason for the error is described here"
        ]
    }
}
cURL
Bash
curl -k --request GET \
	--url 'https://your-domain/api/v1/billing/tree' \
	--header 'Content-Type: application/json' \
	--header 'Accept: application/json' \
	--data '{
    "type": "string",
    "id": 0,
    "external_id": "string|int"
}'
PHP
PHP
$data = array (
  'type' => 'string',
  'id' => 0,
  'external_id' => 'string|int',
);
$context = stream_context_create([
	'ssl'=>['verify_peer' => false],
	'http' => [
		'method' => 'GET',
		'header' => "Content-Type: application/json\r
Accept: application/json",
		'content'=>json_encode($data)
	]
]);
$result = file_get_contents('https://your-domain/api/v1/billing/tree', false, $context);