Purposes & preferences
This section relates to Preferences widgets only.
A widget is built with entities.
You can choose a widget type when creating a widget, allowing you to select one or all selected purposes and preferences from the Configuration Tree. For every element selected including its children (purpose, preference and preference value), an entity is created.
They are needed for either enabling / disabling or reordering certains part of the tree within a widget.
Get a list of entities
To retrieve a list of entities, send a GET request on /widgets/preferences-centers/layout-entities
.
To retrieve an entity of a specific widget, add widget_id
query to following GET request with id
of your widget.
Hide / Display an entity
To hide or display an entity, send a PATCH request on /widgets/preferences-centers/layout-entities/{id}
.
Hide / Display multiple entities
To hide or display multiple entities, send a PATCH request on /widgets/preferences-centers/layout-entities
.
Reorder entities within a widget
First of all, keep in mind you can reorder entities that belong to the same level of nesting within your widget. When reordering one entity, you need to reorder its direct siblings (with the same parent_id
) in order to avoid having siblings with the same order.
To reorder entities, send a PATCH request on /widgets/preferences-centers/layout-entities
.
preference_value_id
are not unique. What makes a preference value unique is the couple selected_preference_id
and preference_value_id
(Mind checking this section to fully understand how relation between preferences and selected preferences works)
When reordering preference values, make sure to target the right parent_id
(aka the layout entity linked to the parent preference)
Last updated