[Help] Where to find relations when getting content item of type tree?

Hey there :blush:

I’ve created a tree model to link all the pages I want to show in my navbar.
I can easily get all the entries in said content item by making a GET request to

COCKPIT_HOST/api/content/items/navbar

This gives me a result similar to this:

[
    {
        "page": "pages://7fe0f08d313737efe2000188",
        "pagename": "Page 1",
        "_pid": null,
        "_o": 0,
        "_modified": 1660654033,
        "_mby": "7f6f355e303630fdc8000059",
        "_created": 1660650431,
        "_state": 1,
        "_cby": "7f6f355e303630fdc8000059",
        "_id": "80ca765738376179670000ad"
    },
    {
        "page": "pages://80b0ed4033376434f30002b6",
        "pagename": "Page 2",
        "_pid": null,
        "_o": 2,
        "_modified": 1660654054,
        "_mby": "7f6f355e303630fdc8000059",
        "_created": 1660650447,
        "_state": 1,
        "_cby": "7f6f355e303630fdc8000059",
        "_id": "80ccdc9b3866613e8c00027f"
    },
    { ... }
]

So far so good.

But what if Page 2 is set as a child of Page 1 in my tree structure? Where can I see this in the API’s response? I can’t see a children, or parent object that indicates that certain entries are linked in a relation.
Am I using the wrong endpoint for this?

Thanks everyone :heart:

_pid is the parent id.

That was all I’ve been looking for. Things can be so easy sometimes … :smile:
Thanks a lot and have a great day :v:

Hi,

is there a way to get this property with GraphQL? With the REST API endpoint, everything seems to be working fine and _pid and _o properties are present, but in GraphQL schema definition, those properties are missing, so they cannot be even queried.

Thanks

Update: GraphQL API meta field inconsistency fixed by https://github.com/Cockpit-HQ/Cockpit/pull/151.