There are generally 3 apis you should APIs to be aware of when working with tree nodes. Each API covers slightly different use cases. Those use cases are outlined in this document.
...
This is the most general use case, where you don’t care about the tree nodes for specific cases and want to manage which tree nodes are availablean integration is managing the tree node definitions.
This requires the Editor_SystemTools_Metadata
role.
There are 6 endpoints to be aware of here. These should feel natural if you have worked with REST before.
Response properties
Name | Type | Description |
---|---|---|
| int | A language-independent id for this tree node. |
| string | A language-independent string value for this tree node. |
| int/null | The |
| int | A value indicating how this node should be sorted in relation to all other tree nodes. |
| int | The metafield id of the tree metafield this node belongs to. |
| int | The itemId of the tree node. |
| string/guid/uuid | The itemGuid of the tree node. |
| dictionary | The translations of this tree node. The key is the languageId. |
| string | The title/name/label of the tree node in this language. |
| int | The language id of this translation. |
| int | The language specific id of this tree node. |
...
Method: GET
Auth required: YES
This will get you gets the tree nodes you have which the authorized user has access to based on item security. You can use . It is available in two flavors. One which returns everything the user has read access to and the /assignable
variant of the endpoint to get only tree nodes you can actually have access rights to assign to assetswhich returns everything the user has write access to. The difference between the two is what the user can assign to an asset and what the user can see as assigned on the asset.
The tree nodes in the response is sorted such that they can be rendered stright straight to a screen without doing any additional sorting.
...