This tutorial demonstrates how to get user permission using job ID via RESTful API.
The steps include:
Get the job ID from searching for jobs
Get the user permission using the job ID
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 the job ID from the list of jobs
Refer to Search Jobs to get the required job ID.
1.3. Get the initial task states
This request can be found in the API Documentation under Tasks marked 'Get user permission'.
Once you have the value for job_id, it should be included in the URL.
Sample Request
curl --location 'http://localhost:8080/api/v1/tasks/getPermission/{job-id-here}' \
--header 'Authorization: Bearer <your-token-here>' \
--header 'Content-Type: application/json' \
Below is a sample response when getting user permission. Click in the line below to see the code.
Sample Response
{
"can_create": true,
"can_edit": true,
"can_delete": true,
"admin": true,
"can_view": true,
"can_read": true,
"can_write": true,
"can_leave_notes": true,
"can_update_attributes": true
}