There are several service lines that work on the same principle. The end points are slightly different but the parameters are the same and depending on the configuration, the possibilities are the same. All details are available in section DAM & DATA API. This page describes the general principle to modify a workflow state or get the list of workflow actions.
In this chapter, the {type of service}
should be replaced by
dam/data
for dam servicesdata
for data services…
If the service is DAM, the object on which the requests are made must have the configuration tag rest_api_dam_workflow
. For data service, the JSON configuration must have the workflow
property set to true.
Change the workflow state of a resource
...
verb:
GET
general form of the URI:
/api/rest/{type of service}/{name of the resource type}/workflow/{id of resource}
See a response sample
For example, with an asset type my_asset_struct id 12345
{server}/api/rest/dam/data/my_asset_struct/workflow/12345
It returns (with debug = false) something like that:
Code Block |
---|
{
"resource": "hexasset",
"name": "Asset",
"description": null,
"response": {
"data": {
"id": 27,
"$uuid": "ag66cdz99rawubcfqj934w6hmo",
"$workflowActions": [
{
"id": "1",
"$uuid": "tbi7gcg8ccok3s4x7apx71xhsdj13tcxrg1pkya",
"name": "publish",
"label": "publish",
"source": {
"id": "2",
"$uuid": "tbi7gcg8ccok3iyuzrybu54ena",
"name": "draft",
"label": "draft",
"color": "#5FA9FF",
"archivedstatus": false,
"onlinestatus": false,
"draftstatus": true,
"deletedstatus": false
},
"target": {
"id": "6",
"$uuid": "tbi7gcg8ccok3npk6fdgqtyymh",
"name": "published",
"label": "published",
"color": "#6AD922",
"archivedstatus": false,
"onlinestatus": true,
"draftstatus": false,
"deletedstatus": false
},
"archivedstatus": false,
"onlinestatus": true,
"draftstatus": false,
"deletedstatus": false
},
{
"id": "7",
"$uuid": "tbi7gcg8ccok3s4x7apx71xhsne55s6prkx64be",
"name": "archive",
"label": "archive",
"source": {
"id": "2",
"$uuid": "tbi7gcg8ccok3iyuzrybu54ena",
"name": "draft",
"label": "draft",
"color": "#5FA9FF",
"archivedstatus": false,
"onlinestatus": false,
"draftstatus": true,
"deletedstatus": false
},
"target": {
"id": "7",
"$uuid": "tbi7gcg8ccok36t45uatq48a5h",
"name": "archived",
"label": "archived",
"color": "#707889",
"archivedstatus": true,
"onlinestatus": false,
"draftstatus": false,
"deletedstatus": false
},
"archivedstatus": true,
"onlinestatus": false,
"draftstatus": false,
"deletedstatus": false
},
{
"id": "8",
"$uuid": "tbi7gcg8ccok3s4x7apx71xhsndtxr4gbx89izy",
"name": "submit",
"label": "submit",
"source": {
"id": "2",
"$uuid": "tbi7gcg8ccok3iyuzrybu54ena",
"name": "draft",
"label": "draft",
"color": "#5FA9FF",
"archivedstatus": false,
"onlinestatus": false,
"draftstatus": true,
"deletedstatus": false
},
"target": {
"id": "8",
"$uuid": "tbi7gcg8ccok38orr8nxsgk7zh",
"name": "validation",
"label": "validation",
"color": "#FCB100",
"archivedstatus": false,
"onlinestatus": false,
"draftstatus": false,
"deletedstatus": false
},
"archivedstatus": false,
"onlinestatus": false,
"draftstatus": false,
"deletedstatus": false
}
]
}
},
"links": {
"href": "https://hexis-int.wedia-group.com/api/rest/dam/data/hexasset/workflow/27"
},
"version": "1.0",
"apiversion": "2.4"
} |
Know the different possible actions to change the state of a resource type
...