Project

General

Profile

API » History » Version 5

Denis Kildishev, 04/22/2020 07:16 PM

1 1 Denis Kildishev
h1. API
2
3 5 Denis Kildishev
All api method calls are needs to have such header
4
Authorization=Bearer 36AC0A0F7F271314B72986EB54DB2343
5
6 1 Denis Kildishev
h2. Experimental
7
8
h3. Test data
9
10
ed612ae4-ced3-408c-8d64-66d87981611f — id of document
11
5b9946fe-585c-47f6-93bb-5bb2e37a04d3 — id of new location
12
b7088d84-9c96-4657-abab-7690585ddd8e — id of requirement
13
14
h3. Methods
15 2 Denis Kildishev
16 5 Denis Kildishev
*Description*: 
17
get document and all locs
18
*Method*: 
19 2 Denis Kildishev
GET
20 5 Denis Kildishev
*Path*:
21 1 Denis Kildishev
http://localhost:9988/projects/someproject/documents/ed612ae4-ced3-408c-8d64-66d87981611f
22
23 5 Denis Kildishev
*Description*: 
24
add location to doc with id before addloc
25
*Method*: 
26 1 Denis Kildishev
PUT
27 5 Denis Kildishev
*Path*: 
28 1 Denis Kildishev
http://localhost:9988/projects/someproject/documents/ed612ae4-ced3-408c-8d64-66d87981611f/addlocation
29
30 5 Denis Kildishev
*Description*: 
31
list all locations
32
*Method*: 
33 1 Denis Kildishev
GET
34 5 Denis Kildishev
*Path*: 
35 1 Denis Kildishev
http://localhost:9988/projects/someproject/documents/ed612ae4-ced3-408c-8d64-66d87981611f/locations
36
37 5 Denis Kildishev
*Description*: 
38 1 Denis Kildishev
get contents of document and all related resourses in form of multidata
39
have fields 
40
*fileName* — name of xhtml file
41
*resources* — list of related resources
42
for example, "imgs/testDoc_html_2f94255ac1355d0d.jpg", "testDoc.xhtml", "imgs/testDoc_html_6a3c8113b28c3ae7.jpg"
43
and several files. File with html content have name «html»
44 5 Denis Kildishev
*Method*: 
45
GET
46
*Path*: 
47
http://localhost:9988/projects/someproject/documents/ed612ae4-ced3-408c-8d64-66d87981611f/fulldata
48 1 Denis Kildishev
49 5 Denis Kildishev
*Description*: 
50
Get contents of xhtml content of document 
51
*Method*: 
52
GET
53
*Path*: 
54
http://localhost:9988/projects/someproject/documents/ed612ae4-ced3-408c-8d64-66d87981611f/contents
55
56
*Description*: 
57
Get contents of xhtml content of document 
58
*Method*: 
59
GET
60
*Path*: 
61
http://localhost:9988/projects/someproject/documents/ed612ae4-ced3-408c-8d64-66d87981611f/contents/{subpath}
62
where subpath is possible path to related resources like /images/1.jpg
63
*Description*: 
64
removes location
65
*Method*: 
66 1 Denis Kildishev
DELETE
67 5 Denis Kildishev
*Path*: 
68 1 Denis Kildishev
http://localhost:9988/projects/someproject/documents/location/5b9946fe-585c-47f6-93bb-5bb2e37a04d3
69 4 Denis Kildishev
70 5 Denis Kildishev
*Description*: 
71
get location
72
*Method*: 
73 4 Denis Kildishev
GET
74 5 Denis Kildishev
*Path*: 
75 1 Denis Kildishev
http://localhost:9988/projects/someproject/documents/location/5b9946fe-585c-47f6-93bb-5bb2e37a04d3
76
77 5 Denis Kildishev
*Description*: 
78
adds fragment to location
79
*Method*: 
80 4 Denis Kildishev
POST
81 5 Denis Kildishev
*Path*: 
82 1 Denis Kildishev
http://localhost:9988/projects/someproject/documents/location/5b9946fe-585c-47f6-93bb-5bb2e37a04d3/addfragment
83 5 Denis Kildishev
*Body*:
84 4 Denis Kildishev
{
85 5 Denis Kildishev
  „start“:“0“,
86
  „end“:“20“
87 1 Denis Kildishev
}
88 4 Denis Kildishev
89 5 Denis Kildishev
*Description*: 
90
removes fragment from location
91
*Method*: 
92 1 Denis Kildishev
POST
93 5 Denis Kildishev
*Path*: 
94 4 Denis Kildishev
http://localhost:9988/projects/someproject/documents/location/5b9946fe-585c-47f6-93bb-5bb2e37a04d3/removefragment
95 5 Denis Kildishev
*Body*:
96 4 Denis Kildishev
{
97 1 Denis Kildishev
	„start“:“0“,
98
        „end“:“20“
99
}
100 4 Denis Kildishev
101 5 Denis Kildishev
*Description*: 
102
add link between requirement and location
103
*Method*: 
104 1 Denis Kildishev
POST
105 5 Denis Kildishev
*Path*: 
106 4 Denis Kildishev
http://localhost:9988/projects/someproject/documents/location/5b9946fe-585c-47f6-93bb-5bb2e37a04d3/linkto/b7088d84-9c96-4657-abab-7690585ddd8e
107 1 Denis Kildishev
108 5 Denis Kildishev
*Description*: 
109
remove link between requirement and location
110
*Method*: 
111 1 Denis Kildishev
DELETE
112 5 Denis Kildishev
*Path*: 
113 1 Denis Kildishev
http://localhost:9988/projects/someproject/documents/location/5b9946fe-585c-47f6-93bb-5bb2e37a04d3/linkto/b7088d84-9c96-4657-abab-7690585ddd8e
114
115 5 Denis Kildishev
*Description*: 
116
list all resources for node
117
*Method*: 
118 1 Denis Kildishev
GET
119 5 Denis Kildishev
*Path*: 
120 1 Denis Kildishev
http://localhost:9988/projects/someproject/resources/ed612ae4-ced3-408c-8d64-66d87981611f
121
122 5 Denis Kildishev
*Description*: 
123
returns content of resource with given subpath
124
*Method*: 
125 1 Denis Kildishev
GET
126 5 Denis Kildishev
*Paths*: 
127 1 Denis Kildishev
http://localhost:9988/projects/someproject/resources/ed612ae4-ced3-408c-8d64-66d87981611f/subpath.xhtml
128
or
129 4 Denis Kildishev
http://localhost:9988/projects/someproject/resources/ed612ae4-ced3-408c-8d64-66d87981611f/images/1.jpg
130
131 5 Denis Kildishev
h2.  Common api description
132 1 Denis Kildishev
133 5 Denis Kildishev
*Description*:
134
Create project
135
*Method	*:
136
PUT
137
*Path*: 	
138
http://localhost:9988/projects/{project_name}
139 4 Denis Kildishev
140 5 Denis Kildishev
*Description*:
141
Delete project
142
*Method*:
143
DELETE
144
*Path*:
145
http://localhost:9988/projects/{project_name}
146 1 Denis Kildishev
147 5 Denis Kildishev
*Description*:
148
List project and all its containment nodes and its attributes
149
*Method*:
150
GET
151
*Path*:
152
http://localhost:9988/projects/{project_name}
153 1 Denis Kildishev
154 5 Denis Kildishev
*Description*:
155
List all enum definitions(user-defined attr types)
156
*Method*:
157
GET
158
*Path*:
159
http://localhost:9988/projects/{project_name}/enumDefs
160 1 Denis Kildishev
161 5 Denis Kildishev
*Description*:
162
Add enum definition
163
*Method*:
164
PUT
165
*Path*:
166
http://localhost:9988/projects/{project_name}/enumDefs
167
*Body*: 
168 4 Denis Kildishev
{
169
	"attributes":{
170
		"3": {
171
		    "value": [
172
		      {
173
			"value": "1"
174
		      },
175
		      {
176
			"value": "2"
177
		      },
178
		      {
179
			"comment"[optional]: "test",
180
			"value": "3"
181
		      }
182
		    ],
183 1 Denis Kildishev
		    "valuesType"[optional, STRING by def]: "STRING",
184
		    "type": "ENUM_DEFINITION"
185
		}
186
	}
187
}
188
189 5 Denis Kildishev
*Description*:
190
force new enum definitions
191
*Method*:
192
POST
193
*Path*:
194
http://localhost:9988/projects/{project_name}/enumDefs
195
Body is the same as for prev.
196 1 Denis Kildishev
197 5 Denis Kildishev
*Description*:
198
Get node and all its attributes
199
*Method*:
200
POST
201
*Path*:
202
http://localhost:9988/projects/{project_name}/node
203
*Body*:
204
Path to node - qualified id, UserVisible Id or UUID
205 1 Denis Kildishev
206 5 Denis Kildishev
*Description*:
207
Get node and all its successors(subtree)
208
*Method*:
209
POST
210
*Path*:
211
http://localhost:9988/projects/{project_name}/tree
212
*Body*:
213
Path to node - qualified id, UserVisible Id or UUID
214 1 Denis Kildishev
215 5 Denis Kildishev
*Description*:
216
Get requirements subtree with all attributes
217
*Method*:
218
GET
219
*Path*:
220
http://localhost:9988/projects/{project_name}/tree
221 4 Denis Kildishev
222 5 Denis Kildishev
*Description*:
223
Get subtree up to {lvl} depth
224
*Method*:
225
POST
226
*Path*:
227
http://localhost:9988/projects/{project_name}/tree-{lvl}
228
*Body*:
229
Path to node - qualified id, UserVisible Id or UUID
230 4 Denis Kildishev
231 5 Denis Kildishev
*Description*:
232
Set attributes
233
*Method*:
234
PUT
235
*Path*:
236
http://localhost:9988/projects/{project_name}/nodes/{uuid_of_node}/attributes/
237
*Datatype*:
238
multipart/form-data
239
*Body*:
240
two type of fields - input contains json, images contains images
241
input example = 
242 4 Denis Kildishev
{
243
  "attributes": {
244
    "test": {
245
      "value": "13d23",
246
      "type": "INT"
247
    },
248 1 Denis Kildishev
    "_name": {
249 4 Denis Kildishev
      "value": "{test} test 123"
250
    },
251 1 Denis Kildishev
    "Ref": {
252 4 Denis Kildishev
      "type": "REFERENCE",
253
      "value":"test"
254
    }
255
  "2": {
256
    "value": [
257
      {
258
        "value": "001 2/001"
259
      },
260
      {
261
        "value": "002/001/001"
262
      },
263
      {
264
        "value": "Requirements"
265
      }
266
    ],
267
    "valuesType": "REFERENCE",
268
    "type": "LIST"
269
  },
270
  "3val": {
271
    "value": "1",
272
    "enumName": "3",
273
    "type": "ENUM"
274 1 Denis Kildishev
  }
275 4 Denis Kildishev
}
276
277 5 Denis Kildishev
*Description*:
278
Delete attributes
279
*Method*:
280
DELETE
281
*Path*:
282
http://localhost:9988/projects/{project_name}/nodes/{uuid_of_node}/attributes/
283
*Body*: 
284
{name1}, {name2}...
285
*Returns*:
286
Current set of attributes
287 4 Denis Kildishev
288 5 Denis Kildishev
*Description*:
289
Delete node
290
*Method*:
291
DELETE
292
*Path*:
293
http://localhost:9988/projects/{project_name}/node
294
*Body*:
295
Path to node - qualified id, UserVisible Id or UUID
296
*Returns*:
297
New subtree from parent of deleted node
298 4 Denis Kildishev
299 5 Denis Kildishev
*Description*:
300
Move node without autorename, if node with new name exists then returns error
301
*Method*:
302
POST
303
*Path*:
304
http://localhost:9988/projects/{project_name}/nodes/{uuid_of_node}/move
305
*Body*:
306
Path to node - qualified id, UserVisible Id or UUID
307
*Returns*:
308
New subtree from parent of moved node
309 4 Denis Kildishev
310 5 Denis Kildishev
*Description*:
311
Move node withautorename
312
*Method*:
313
POST
314
*Path*:
315
http://localhost:9988/projects/{project_name}/nodes/{uuid_of_node}/move-rename
316
*Body*:
317
Path to node - qualified id, UserVisible Id or UUID
318
*Returns*:
319
New subtree from parent of moved node
320 4 Denis Kildishev
321 5 Denis Kildishev
*Description*:
322
Move node after given one with autorename
323
*Method*:
324
POST
325
*Path*:
326
http://localhost:9988/projects/{project_name}/nodes/{uuid_of_node}/move-after
327
*Body*:
328
Path to node after which target node needs to be moved - qualified id, UserVisible Id or UUID
329
New subtree from parent of moved node
330 4 Denis Kildishev
331 5 Denis Kildishev
*Description*:
332
Get identifier
333
*Method*:
334
GET
335
*Path*:
336
http://localhost:9988/projects/{project_name}/nodes/{uuid_of_node}/id
337
*Returns*:
338
Id, qualifiedId and user-visible id
339 4 Denis Kildishev
340 5 Denis Kildishev
*Description*:
341
Rename a node
342
*Method*:
343
PUT
344
*Path*:
345
http://localhost:9988/projects/{project_name}/nodes/{uuid_of_node}/id
346
*Body*:
347
New id of node
348
*Returns*:
349
new id, qualifiedId and user-visible id of node
350 4 Denis Kildishev
351 5 Denis Kildishev
*Description*:
352
Create a node
353
*Method*:
354
PUT
355
*Path*:
356
http://localhost:9988/projects/{project_name}/create
357
*Datatype*:
358
multipart/form-data
359
*Body*:
360
two kinds of fields - input contains json, images contains images
361
input example = 
362 4 Denis Kildishev
{
363
	"parent": "516bbbbc-babf-45d6-a146-61db334411be",     
364
	"type":"Requirement",     
365
	"id":"002",            
366
	"attributes":{         
367
		"test": {
368
	           "value": "13d23",
369
	           "type": "INT"         
370
		},
371
		"_name": {           
372
			"value": "{test} test 123"         
373 1 Denis Kildishev
		},
374
		 "Ref": {
375
			"type": "REFERENCE",
376
			"value":"test"
377
		},
378
		"_description": {
379
			"value":"test desc <img src='strange.png' alt='strange.xcf'/>", 			"type":"HTML"
380
		}      
381
	}     
382
}
383 5 Denis Kildishev
"id" identifier is optional
384
*Example of output*:
385
List of references
386 1 Denis Kildishev
2: {
387
"valuesType": "REFERENCE",
388
"value": [
389
  {
390
"nodes": [
391
  "71f2c6d9-aa54-4293-95d4-ed0d50fba6c1"
392
],
393
"value": "001 2/001"
394
},
395
  {
396
"value": "*Missing: '002/001/001'"
397
},
398
  {
399
"nodes": [
400
  "516bbbbc-babf-45d6-a146-61db334411be"
401
],
402
"value": "Requirements"
403
}
404
],
405
"type": "LIST"
406
},
407 5 Denis Kildishev
Link with error
408 1 Denis Kildishev
1: {
409
"value": "*Missing: '002/001/001'",
410
"type": "REFERENCE"
411
},
412 5 Denis Kildishev
enum def(GET http://localhost:9988/projects/{project_name}/enumDefs)
413 1 Denis Kildishev
{
414
"success": true,
415
"result": {
416
"attributes": {
417
3: {
418
"value": [
419
  {
420
"comment": null,
421
"value": "1"
422
},
423
  {
424
"comment": null,
425
"value": "2"
426
},
427
  {
428
"comment": null,
429
"value": "3"
430
}
431
],
432
"valuesType": "INT",
433
"type": "ENUM_DEFINITION"
434
}
435
}
436
}
437
}
438 5 Denis Kildishev
Enum value needs to be contained in enum def with name enumName
439 1 Denis Kildishev
    "3Value": {
440
      "type": "ENUM",
441
      "enumName": "3",
442
      "value": "1"
443
    },