Breadcrumbs

Get a tree

When querying a tree, the root elements are returned by default. To get subelements, you must pass the identifier of the element whose subelements you want to get.

The identifier can be id or external_id.




GET/api/v1/billing/tree

Headers

Accept

application/json

Body

typerequired

string

Tree type to get.

idrequired

int

Tree type ID whose subelements are to be retrieved

external_idrequired

string|int

Own key of the tree element whose subelements are to be retrieved

Response




200

Successful response

JSON
[
                {
                    "id": 14,
                    "name": "Name of item 1",
                    "external_id": "unique_key_1",
                    "has_items": true
                },{
                    "id": 15,
                    "name": "Name of item 2",
                    "external_id": "unique_key_2",
                    "has_items": false
                },{
                    "id": 16,
                    "name": "Name of item 3",
                    "external_id": null,
                    "has_items": false
                }
            ]




422

Returns a JSON object with an error. Validation

JSON
{
    "message": "There will be no informative message here",
    "errors": {
        "any_key": [
            "The reason for the error will be described here."
        ]
    }
}

Example

JSON
curl -k --location --request GET 'https://vms.local/api/v1/billing/tree' \
--header 'Accept:application/json'