Configuration Tree
Configuration Tree is the data model used to guarantee the consistency of your data at all times, and on your widgets. There is a unique Configuration Tree by organization.

Get a Configuration Tree

To retrieve data of your Configuration Tree, send a GET request on /config-trees.
1
GET https://api.didomi.io/config-trees?organization_id=YOUR_ORG_ID
2
3
[
4
{
5
"id": "String",
6
"created_at": "Date",
7
"updated_at": "Date",
8
"organization_id": "String",
9
"selected_purposes": [
10
{
11
"id": "string",
12
"created_at": "Date",
13
"updated_at": "Date",
14
"purpose": {
15
"id": "String",
16
"organization_id": "String",
17
"description": {},
18
"details": {}
19
},
20
"purpose_id": "String",
21
"configuration_tree_id": "String",
22
"order": 0,
23
"selected_preferences": [
24
{
25
"id": "String",
26
"created_at": "Date",
27
"updated_at": "Date",
28
"selected_preferences": [
29
{
30
"id": "String",
31
"created_at": "Date",
32
"updated_at": "Date",
33
"selected_preferences": [
34
{}
35
],
36
"parent_id": "String",
37
"preference": {
38
"id": "String",
39
"created_at": "Date",
40
"updated_at": "Date",
41
"name": {
42
"en": "String"
43
},
44
"description": {
45
"en": "String"
46
},
47
"organization_id": "String",
48
"type": "single",
49
"values": [
50
{
51
"id": "String",
52
"created_at": "Date",
53
"updated_at": "Date",
54
"name": {
55
"en": "String"
56
},
57
}
58
]
59
},
60
"parent_selected_purpose_id": "String",
61
"parent_preference_value_id": "String",
62
"order": 0,
63
"configuration_tree_id": "String"
64
}
65
],
66
"parent_id": "String",
67
"preference": {
68
"id": "String",
69
"created_at": "Date",
70
"updated_at": "Date",
71
"name": {
72
"en": "String"
73
},
74
"description": {
75
"en": "String"
76
},
77
"organization_id": "String",
78
"type": "single",
79
"values": [
80
{
81
"id": "String",
82
"created_at": "Date",
83
"updated_at": "Date",
84
"name": {
85
"en": "String"
86
},
87
"selected_preferences": [
88
{}
89
]
90
}
91
]
92
},
93
"parent_selected_purpose_id": "String",
94
"parent_preference_value_id": "String",
95
"order": 0,
96
"configuration_tree_id": "String"
97
}
98
]
99
}
100
]
101
}
102
]
Copied!
Optional query parameters:
  • $limit: number of max results to return
  • $skip: number of results to skip
  • $sort: represents sorting options. Accepts properties to sort as keys and -1 or 1 for sort direction
  • $with[]: list of entity names to join, values possible : purpose, preference

Edit your Configuration Tree

Add a purpose into your Configuration Tree

To add a purpose into your Configuration Tree, send a POST request on /config-trees/{configuration_tree_id}/selected-purposes.
To retrieve purposes from you Data Manager, you can send a GET request on /metadata/purposes.
1
POST https://api.didomi.io/config-trees/{configuration_tree_id}/selected-purposes?organization_id=YOUR_ORG_ID
2
3
{
4
"purpose_id": "YOUR_PURPOSE_ID",
5
"order": 0
6
}
Copied!

Add a preference into your Configuration Tree

To add a preference into your Configuration Tree, send a POST request on /config-trees/{configuration_tree_id}/selected-preferences.
To retrieve preferences from you Preferences Library, you can send a GET request on /preferences.
1
POST https://api.didomi.io/config-trees/{configuration_tree_id}/selected-preferences?organization_id=YOUR_ORG_ID
2
3
{
4
"preference_id": "string",
5
"parent_selected_purpose_id": "string",
6
"order": 0,
7
"parent_id": "string",
8
"parent_preference_value_id": "string"
9
}
Copied!
Element
Required
Description
configuration_tree_id
Yes
id of the Configuration Tree
organization_id
Yes
id of the organization
preference_id
Yes
id of the preference
parent_selected_purpose_id
Yes
id of the SelectedPurpose the SelectedPreference belongs to.
order
Yes
Order of SelectedPurpose in Configuration Tree
parent_id
Yes, if nesting inside a preference value
id of the SelectedPreference the nested SelectedPreference belongs to.
parent_preference_value_id
Yes, if nested inside a preference value
id of the value the nested SelectedPreference belongs to.

Delete a SelectedPurpose

To delete a purpose from your Configuration Tree, send a DELETE request on /config-trees/{configuration_tree_id}/selected-purposes/{id}.
All SelectedPreferences nested inside the SelectedPurpose will be removed too.
1
DELETE https://api.didomi.io/config-trees/{configuration_tree_id}/selected-purposes/{selected_purposes_id}?organization_id=YOUR_ORG_ID
Copied!

Delete a SelectedPreference

To delete a preference from your Configuration Tree, send a DELETE request on /config-trees/{configuration_tree_id}/selected-preferences/{id}.
All SelectedPreferences nested inside the SelectedPreference will be removed too.
1
DELETE https://api.didomi.io/config-trees/{configuration_tree_id}/selected-preferences/{selected_preferences_id}?organization_id=YOUR_ORG_ID
Copied!

Delete multiple SelectedPreferences

To delete multiple preferences from your Configuration Tree, send a DELETE request on /config-trees/{configuration_tree_id}/selected-preferences?id[]={id}.
All SelectedPreferences nested inside the SelectedPreference will be removed too.
1
DELETE https://api.didomi.io/config-trees/{configuration_tree_id}/selected-preferences/?organization_id=YOUR_ORG_ID&id[]=ID
Copied!
id query params have to follow array format id[] pattern.