This tutorial demonstrates how to get the task types via RESTful API.
The steps include:
Getting the task types
The commands are provided in curl and can be run from the command prompt when the Synergy Server is running (or in a batch script).
Additional API documentation
To get a list of most of the API requests available, with the 12d Synergy server running, browse http://synergy.myserver.com/api-docs/ui/index.
(Replace synergy.myserver.com with the external server address and update the port numbers if necessary.)
1.1. Getting the Personal Access Token to access API
The tutorial for getting the PAT is here: Generate PAT in Web client.
1.2. Get a specific task
This request can be found in the API Documentation under Tasks marked 'Get task types'.
It also should have a get_attributes parameter with true/false value.
Sample Request
curl --location 'http://localhost:8080/api/v1/tasks/getTaskTypes?get_attributes=false' \
--header 'Authorization: Bearer <your-token-here>' \
--header 'Content-Type: application/json' \
Below is a sample response when getting the task types. Click in the line below to see the code.
Sample Response
[
{
"task_type_id": {
"_id": 1,
"_server_id": 1,
"_server_guid": "b993c729-bf98-490c-989d-5621e3b48139",
"IDString": "1_1"
},
"name": "Generic",
"colour": "#000000",
"description": "The generic task type",
"created_by_id": null,
"create_date_utc": "2024-12-10T01:48:00.287",
"dependent_task_action": null,
"start_task_action": null,
"workflow_id": null,
"id": {
"_id": 1,
"_server_id": 1,
"_server_guid": "b993c729-bf98-490c-989d-5621e3b48139",
"IDString": "1_1"
},
"attributes": [],
"Type": 56
},
{
"task_type_id": {
"_id": 2,
"_server_id": 1,
"_server_guid": "b993c729-bf98-490c-989d-5621e3b48139",
"IDString": "2_1"
},
"name": "Sync",
"colour": "#000000",
"description": "<HTML><HEAD></HEAD><BODY>Task type for sync tool</BODY></HTML>",
"created_by_id": {
"_id": 1,
"_server_id": 1,
"_server_guid": "b993c729-bf98-490c-989d-5621e3b48139",
"IDString": "1_1"
},
"create_date_utc": "2024-12-13T01:52:38.743",
"dependent_task_action": null,
"start_task_action": null,
"workflow_id": null,
"id": {
"_id": 2,
"_server_id": 1,
"_server_guid": "b993c729-bf98-490c-989d-5621e3b48139",
"IDString": "2_1"
},
"attributes": [],
"Type": 56
},
{
"task_type_id": {
"_id": 3,
"_server_id": 1,
"_server_guid": "b993c729-bf98-490c-989d-5621e3b48139",
"IDString": "3_1"
},
"name": "Sync User",
"colour": "#000000",
"description": "<HTML><HEAD></HEAD><BODY>Task type for sync tool, used for individual syncs</BODY></HTML>",
"created_by_id": {
"_id": 1,
"_server_id": 1,
"_server_guid": "b993c729-bf98-490c-989d-5621e3b48139",
"IDString": "1_1"
},
"create_date_utc": "2024-12-13T01:52:38.817",
"dependent_task_action": null,
"start_task_action": null,
"workflow_id": null,
"id": {
"_id": 3,
"_server_id": 1,
"_server_guid": "b993c729-bf98-490c-989d-5621e3b48139",
"IDString": "3_1"
},
"attributes": [],
"Type": 56
}
]