Unicat API Reference

Up - API Reference - Home


/api/p/<project gid>/assets/children

Requires JWT.

Get the children of an asset in the tree (the contents of a folder).

Request

You get the children of an asset either by specifying the gid in asset or by giving a pathname parameter for the parent.

If you provide both asset and pathname parameters, then we use parameter matching to guess what you meant. The first action that matches the parameters is performed, the rest is ignored. Parameter matching happens in the order given below:

POST /api/p/<project gid>/assets/children
Authorization: Bearer <JWT>

{
    "asset": "<asset gid>"
}

or

POST /api/p/<project gid>/assets/children
Authorization: Bearer <JWT>

{
    "pathname": "/products"
}

asset is the gid for the parent of the children.

pathname is the pathname for the parent of the children.

optional

page.top (default 0) only return assets starting from the top-index (0-based).
page.size (default 100) only return this many assets.

Success response

Authorization: <JWT>

{
    "success": true,
    "result": {
        "children": [
            "96ec02b2-fb8d-4fb4-b952-fad0c4b88a74",
            "726427c2-8c72-4d2e-a09b-937a6f16d3c0",
            "98437ffb-ef37-431a-afc2-d6023e0db58c",
            "7c136ddb-4dfa-4ec1-bad4-15067cbf80d9",
            "7e52202a-90bb-430b-8ac5-e9c015da4369"
        ],
        "children.size": 5
    },
    "data": {
        "assets": {
            "96ec02b2-fb8d-4fb4-b952-fad0c4b88a74": {
                
            },
            
        }
    }
}

result

children the requested children, ordered by type (folders first), then by name, filtered by pagination. If there are no children, you'll get an empty list.
children.size the number of unpaginated children.

data

assets Asset info with hierarchy, type, name. Unordered.

Error responses

400 Bad request - missing parameters or wrong type or value
401 Unauthorized - missing or expired JWT
403 Forbidden - not a member of this project
422 Unprocessable entity - asset doesn't exist