<
From version < 1.2 >
edited by Outhman Moustaghfir
on 2021/11/29 15:02
To version < 2.2 >
edited by Outhman Moustaghfir
on 2021/11/29 15:11
>
Change comment: There is no comment for this version

Summary

Details

Page properties
Content
... ... @@ -1,10 +1,10 @@
1 1  = Introduction =
2 2  
3 -The endpoints below help in creating, updating , deleting or getting DataLists.
3 +The endpoints below help in creating, updating, deleting, or getting DataLists.
4 4  
5 5  = Endpoints =
6 6  
7 -All datalists are grouped by the current envrionment.
7 +All datalists are grouped by the current environment.
8 8  
9 9  |(% style="width:261px" %)**URL [method]**|(% style="width:318px" %)**Description**|(% style="width:405px" %)**Input example**|(% style="width:460px" %)**Output example**|(% style="width:205px" %)**Comments**
10 10  |(% style="width:261px" %)/rest/datalist [GET]|(% style="width:318px" %)get all datalists of the current environment.|(% style="width:405px" %)(no input required)|(% style="width:460px" %)(((
... ... @@ -75,7 +75,57 @@
75 75  }
76 76  {{/code}}
77 77  )))|(% style="width:205px" %)
78 -|(% style="width:261px" %)/rest/datalist/{alias} [GET]|(% style="width:318px" %)get a datalist by alias.|(% style="width:405px" %) |(% style="width:460px" %) |(% style="width:205px" %)
78 +|(% style="width:261px" %)/rest/datalist/{alias} [GET]|(% style="width:318px" %)get a datalist by alias.|(% style="width:405px" %)(((
79 +the {alias} must be replaced by the wanted alias.
80 +
81 +eg :
82 +
83 +/rest/datalist/city
84 +
85 +/rest/datalist/country
86 +
87 +
88 +)))|(% style="width:460px" %)(((
89 +for : /rest/datalist/city, the response will look like :
90 +
91 +{{code language="JSON"}}
92 +{
93 + "timestamp": 1638194572812,
94 + "status": "200",
95 + "data": {
96 + "datalistid": null,
97 + "alias": "city",
98 + "label": {
99 + "fr": "Ville",
100 + "en": "City"
101 + },
102 + "env": "iXPath",
103 + "global": false,
104 + "values": [
105 + {
106 + "alias": "Casablanca",
107 + "label": {
108 + "fr": "Casablanca",
109 + "en": "Casablanca"
110 + },
111 + "value": "Casablanca"
112 + },
113 + {
114 + "alias": "Fez",
115 + "label": {
116 + "fr": "Fes",
117 + "en": "Fez"
118 + },
119 + "value": "Fez"
120 + }
121 + ]
122 + }
123 +}
124 +{{/code}}
125 +
126 +
127 +
128 +)))|(% style="width:205px" %)
79 79  |(% style="width:261px" %)/rest/datalist [POST]|(% style="width:318px" %)add a new datalist.|(% style="width:405px" %)(((
80 80  
81 81  
... ... @@ -143,7 +143,93 @@
143 143  }
144 144  {{/code}}
145 145  )))|(% style="width:205px" %)
146 -|(% style="width:261px" %)/rest/datalist/{alias} [PUT]|(% style="width:318px" %)update an existing datalist by alias|(% style="width:405px" %) |(% style="width:460px" %) |(% style="width:205px" %)
196 +|(% style="width:261px" %)/rest/datalist/{alias} [PUT]|(% style="width:318px" %)update an existing datalist by the alias|(% style="width:405px" %)(((
197 +to update the datalist, we need to replace the {alias} brackets with the concerned datalist's alias **And **add a JSON body like:
198 +
199 +{{code language="json"}}
200 +{
201 + "alias" : "city",
202 + "label" : {
203 + "fr" : "Ville",
204 + "en" : "City"
205 + },
206 + "global" : false,
207 + "values" : [ {
208 + "alias" : "Casablanca",
209 + "label" : {
210 + "fr" : "Casablanca",
211 + "en" : "Casablanca"
212 + },
213 + "value" : "Casablanca"
214 + },
215 + {
216 + "alias" : "Fez",
217 + "label" : {
218 + "fr" : "Fes",
219 + "en" : "Fez"
220 + },
221 + "value" : "Fez"
222 + },
223 + {
224 + "alias" : "London",
225 + "label" : {
226 + "fr" : "Londres",
227 + "en" : "London"
228 + },
229 + "value" : "london"
230 + }]
231 +}
232 +{{/code}}
233 +
234 +we added a new value to datalist's values list.
235 +
236 +
237 +)))|(% style="width:460px" %)(((
238 +the response is the object updated to the database.
239 +
240 +{{code language="json"}}
241 +{
242 + "timestamp": 1638194808497,
243 + "status": "200",
244 + "data": {
245 + "datalistid": null,
246 + "alias": "city",
247 + "label": {
248 + "fr": "Ville",
249 + "en": "City"
250 + },
251 + "env": "iXPath",
252 + "global": false,
253 + "values": [
254 + {
255 + "alias": "Casablanca",
256 + "label": {
257 + "fr": "Casablanca",
258 + "en": "Casablanca"
259 + },
260 + "value": "Casablanca"
261 + },
262 + {
263 + "alias": "Fez",
264 + "label": {
265 + "fr": "Fes",
266 + "en": "Fez"
267 + },
268 + "value": "Fez"
269 + },
270 + {
271 + "alias": "London",
272 + "label": {
273 + "fr": "Londres",
274 + "en": "London"
275 + },
276 + "value": "london"
277 + }
278 + ]
279 + }
280 +}
281 +{{/code}}
282 +)))|(% style="width:205px" %)
147 147  |(% style="width:261px" %)/rest/datalist/{alias} [DELETE]|(% style="width:318px" %)delete a datalist by alias.|(% style="width:405px" %) |(% style="width:460px" %) |(% style="width:205px" %)
148 148  
149 149  
This wiki is hosted and managed by iXPath
Powered by XWiki 13.3 debian