Unicat API Reference

Up - API Reference - Home


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

Requires JWT.

Get the children of a record in the tree.

You can specify which languages you want in the results.

Request

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

{
    "record": "<record gid>",
    "languages": ["en", "nl"]
}

record is the record's gid, the parent of the children.

optional

language return data for this (project) language.
languages return data for these (project) languages.
channel (default all) only return records that are in this channel.
ordering (default unordered) return records in this order.
page.top (default 0) only return records starting from the top-index (0-based).
page.size (default 100) only return this many records.

Always specify the ordering if you use page.top and page.size.

If you request language and/or languages, you get the records' title and fields for the combined set. If you request neither, you'll get all available languages.

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

{
    "record": "e72b9304-11eb-45f8-8701-175aaf1e68b0",
    "language": "en",
    "channel": "4782d5f5-b62b-4ecb-bf71-5be637a15dc5",
    "ordering": "87b53a4e-359d-45c7-81cb-5e1c3ef444ec",
    "page.top": 0,
    "page.size": 10
}

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": {
        "records": {
            "96ec02b2-fb8d-4fb4-b952-fad0c4b88a74": {
                
            },
            
        }
    }
}

result

children the requested children, filtered by channel and pagination, in ordering order. If there are no children, you'll get an empty list.
children.size the number of unpaginated children, filtered by channel.

data

records Record info with hierarchy, definition, field values. 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 - can't work with this item