Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

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

treeNodeId

int

A language-independent id for this tree node.

optionValue

string

A language-independent string value for this tree node.

parentId

int/null

The treeNodeId of the parent node of this node. Or null if the node doesn’t have a parent.

sortIndex

int

A value indicating how this node should be sorted in relation to all other tree nodes.

metaFieldId

int

The metafield id of the tree metafield this node belongs to.

itemId

int

The itemId of the tree node.

itemGuid

string/guid/uuid

The itemGuid of the tree node.

labels

dictionary

The translations of this tree node. The key is the languageId.

labels.label

string

The title/name/label of the tree node in this language.

labels.languageId

int

The language id of this translation.

labels.treeValueId

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.

...