Purposes & preferences
Last updated
Last updated
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 or certains part of the tree within a widget.
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.
To hide or display an entity, send a PATCH request on /widgets/preferences-centers/layout-entities/{id}
.
To hide or display multiple entities, send a PATCH request on /widgets/preferences-centers/layout-entities
.
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
.
When reordering preference values, make sure to target the right parent_id
(aka the layout entity linked to the parent preference)
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 to fully understand how relation between preferences and selected preferences works)