API » History » Revision 5
« Previous |
Revision 5/6
(diff)
| Next »
Denis Kildishev, 04/22/2020 07:16 PM
API¶
All api method calls are needs to have such header
Authorization=Bearer 36AC0A0F7F271314B72986EB54DB2343
Experimental¶
Test data¶
ed612ae4-ced3-408c-8d64-66d87981611f — id of document
5b9946fe-585c-47f6-93bb-5bb2e37a04d3 — id of new location
b7088d84-9c96-4657-abab-7690585ddd8e — id of requirement
Methods¶
Description:
get document and all locs
Method:
GET
Path:
http://localhost:9988/projects/someproject/documents/ed612ae4-ced3-408c-8d64-66d87981611f
Description:
add location to doc with id before addloc
Method:
PUT
Path:
http://localhost:9988/projects/someproject/documents/ed612ae4-ced3-408c-8d64-66d87981611f/addlocation
Description:
list all locations
Method:
GET
Path:
http://localhost:9988/projects/someproject/documents/ed612ae4-ced3-408c-8d64-66d87981611f/locations
Description:
get contents of document and all related resourses in form of multidata
have fields
fileName — name of xhtml file
resources — list of related resources
for example, "imgs/testDoc_html_2f94255ac1355d0d.jpg", "testDoc.xhtml", "imgs/testDoc_html_6a3c8113b28c3ae7.jpg"
and several files. File with html content have name «html»
Method:
GET
Path:
http://localhost:9988/projects/someproject/documents/ed612ae4-ced3-408c-8d64-66d87981611f/fulldata
Description:
Get contents of xhtml content of document
Method:
GET
Path:
http://localhost:9988/projects/someproject/documents/ed612ae4-ced3-408c-8d64-66d87981611f/contents
Description:
Get contents of xhtml content of document
Method:
GET
Path:
http://localhost:9988/projects/someproject/documents/ed612ae4-ced3-408c-8d64-66d87981611f/contents/{subpath}
where subpath is possible path to related resources like /images/1.jpg
Description:
removes location
Method:
DELETE
Path:
http://localhost:9988/projects/someproject/documents/location/5b9946fe-585c-47f6-93bb-5bb2e37a04d3
Description:
get location
Method:
GET
Path:
http://localhost:9988/projects/someproject/documents/location/5b9946fe-585c-47f6-93bb-5bb2e37a04d3
Description:
adds fragment to location
Method:
POST
Path:
http://localhost:9988/projects/someproject/documents/location/5b9946fe-585c-47f6-93bb-5bb2e37a04d3/addfragment
Body:
{
„start“:“0“,
„end“:“20“
}
Description:
removes fragment from location
Method:
POST
Path:
http://localhost:9988/projects/someproject/documents/location/5b9946fe-585c-47f6-93bb-5bb2e37a04d3/removefragment
Body:
{
„start“:“0“,
„end“:“20“
}
Description:
add link between requirement and location
Method:
POST
Path:
http://localhost:9988/projects/someproject/documents/location/5b9946fe-585c-47f6-93bb-5bb2e37a04d3/linkto/b7088d84-9c96-4657-abab-7690585ddd8e
Description:
remove link between requirement and location
Method:
DELETE
Path:
http://localhost:9988/projects/someproject/documents/location/5b9946fe-585c-47f6-93bb-5bb2e37a04d3/linkto/b7088d84-9c96-4657-abab-7690585ddd8e
Description:
list all resources for node
Method:
GET
Path:
http://localhost:9988/projects/someproject/resources/ed612ae4-ced3-408c-8d64-66d87981611f
Description:
returns content of resource with given subpath
Method:
GET
Paths:
http://localhost:9988/projects/someproject/resources/ed612ae4-ced3-408c-8d64-66d87981611f/subpath.xhtml
or
http://localhost:9988/projects/someproject/resources/ed612ae4-ced3-408c-8d64-66d87981611f/images/1.jpg
Common api description¶
Description:
Create project
Method *:
PUT
*Path:
http://localhost:9988/projects/{project_name}
Description:
Delete project
Method:
DELETE
Path:
http://localhost:9988/projects/{project_name}
Description:
List project and all its containment nodes and its attributes
Method:
GET
Path:
http://localhost:9988/projects/{project_name}
Description:
List all enum definitions(user-defined attr types)
Method:
GET
Path:
http://localhost:9988/projects/{project_name}/enumDefs
Description:
Add enum definition
Method:
PUT
Path:
http://localhost:9988/projects/{project_name}/enumDefs
Body:
{
"attributes":{
"3": {
"value": [
{
"value": "1"
},
{
"value": "2"
},
{
"comment"[optional]: "test",
"value": "3"
}
],
"valuesType"[optional, STRING by def]: "STRING",
"type": "ENUM_DEFINITION"
}
}
}
Description:
force new enum definitions
Method:
POST
Path:
http://localhost:9988/projects/{project_name}/enumDefs
Body is the same as for prev.
Description:
Get node and all its attributes
Method:
POST
Path:
http://localhost:9988/projects/{project_name}/node
Body:
Path to node - qualified id, UserVisible Id or UUID
Description:
Get node and all its successors(subtree)
Method:
POST
Path:
http://localhost:9988/projects/{project_name}/tree
Body:
Path to node - qualified id, UserVisible Id or UUID
Description:
Get requirements subtree with all attributes
Method:
GET
Path:
http://localhost:9988/projects/{project_name}/tree
Description:
Get subtree up to {lvl} depth
Method:
POST
Path:
http://localhost:9988/projects/{project_name}/tree-{lvl}
Body:
Path to node - qualified id, UserVisible Id or UUID
Description:
Set attributes
Method:
PUT
Path:
http://localhost:9988/projects/{project_name}/nodes/{uuid_of_node}/attributes/
Datatype:
multipart/form-data
Body:
two type of fields - input contains json, images contains images
input example =
{
"attributes": {
"test": {
"value": "13d23",
"type": "INT"
},
"_name": {
"value": "{test} test 123"
},
"Ref": {
"type": "REFERENCE",
"value":"test"
}
"2": {
"value": [
{
"value": "001 2/001"
},
{
"value": "002/001/001"
},
{
"value": "Requirements"
}
],
"valuesType": "REFERENCE",
"type": "LIST"
},
"3val": {
"value": "1",
"enumName": "3",
"type": "ENUM"
}
}
Description:
Delete attributes
Method:
DELETE
Path:
http://localhost:9988/projects/{project_name}/nodes/{uuid_of_node}/attributes/
Body:
{name1}, {name2}...
Returns:
Current set of attributes
Description:
Delete node
Method:
DELETE
Path:
http://localhost:9988/projects/{project_name}/node
Body:
Path to node - qualified id, UserVisible Id or UUID
Returns:
New subtree from parent of deleted node
Description:
Move node without autorename, if node with new name exists then returns error
Method:
POST
Path:
http://localhost:9988/projects/{project_name}/nodes/{uuid_of_node}/move
Body:
Path to node - qualified id, UserVisible Id or UUID
Returns:
New subtree from parent of moved node
Description:
Move node withautorename
Method:
POST
Path:
http://localhost:9988/projects/{project_name}/nodes/{uuid_of_node}/move-rename
Body:
Path to node - qualified id, UserVisible Id or UUID
Returns:
New subtree from parent of moved node
Description:
Move node after given one with autorename
Method:
POST
Path:
http://localhost:9988/projects/{project_name}/nodes/{uuid_of_node}/move-after
Body:
Path to node after which target node needs to be moved - qualified id, UserVisible Id or UUID
New subtree from parent of moved node
Description:
Get identifier
Method:
GET
Path:
http://localhost:9988/projects/{project_name}/nodes/{uuid_of_node}/id
Returns:
Id, qualifiedId and user-visible id
Description:
Rename a node
Method:
PUT
Path:
http://localhost:9988/projects/{project_name}/nodes/{uuid_of_node}/id
Body:
New id of node
Returns:
new id, qualifiedId and user-visible id of node
Description:
Create a node
Method:
PUT
Path:
http://localhost:9988/projects/{project_name}/create
Datatype:
multipart/form-data
Body:
two kinds of fields - input contains json, images contains images
input example =
{
"parent": "516bbbbc-babf-45d6-a146-61db334411be",
"type":"Requirement",
"id":"002",
"attributes":{
"test": {
"value": "13d23",
"type": "INT"
},
"_name": {
"value": "{test} test 123"
},
"Ref": {
"type": "REFERENCE",
"value":"test"
},
"_description": {
"value":"test desc <img src='strange.png' alt='strange.xcf'/>", "type":"HTML"
}
}
}
"id" identifier is optional
Example of output:
List of references
2: {
"valuesType": "REFERENCE",
"value": [
{
"nodes": [
"71f2c6d9-aa54-4293-95d4-ed0d50fba6c1"
],
"value": "001 2/001"
},
{
"value": "*Missing: '002/001/001'"
},
{
"nodes": [
"516bbbbc-babf-45d6-a146-61db334411be"
],
"value": "Requirements"
}
],
"type": "LIST"
},
Link with error
1: {
"value": "*Missing: '002/001/001'",
"type": "REFERENCE"
},
enum def(GET http://localhost:9988/projects/{project_name}/enumDefs)
{
"success": true,
"result": {
"attributes": {
3: {
"value": [
{
"comment": null,
"value": "1"
},
{
"comment": null,
"value": "2"
},
{
"comment": null,
"value": "3"
}
],
"valuesType": "INT",
"type": "ENUM_DEFINITION"
}
}
}
}
Enum value needs to be contained in enum def with name enumName
"3Value": {
"type": "ENUM",
"enumName": "3",
"value": "1"
},
Updated by Denis Kildishev over 4 years ago · 6 revisions