This tutorial demonstrates how to search for job items via the RESTful API.
Jobs have job items which consist of sub-jobs, sub-folders, and files.
The steps include:
Searching for job items 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. Search for a job using the job name
This request can be found in the API documentation under Jobs marked 'Get job items'.
Below is a sample for searching job items with the ID.
Sample Request
curl --location 'http://synergy.myserver.com/api/v1/jobs/{job-id}/items' \
--header 'Authorization: Bearer <your-token-here>' \
--header 'Content-Type: application/json'
Below is a sample response for job items for a specific job. Click in the line below to see the code.
Sample Response
{
"HasTeam": false,
"HasIssuedFilesRegistry": false,
"SubJobs": [],
"SubFolders": [
{
"ID": {
"_id": 2,
"_server_id": 1,
"_server_guid": "b993c729-bf98-490c-989d-5621e3b48139",
"IDString": "2_1"
},
"Name": "Some Folder",
"ParentFolderID": null,
"JobID": {
"_id": 1,
"_server_id": 1,
"_server_guid": "b993c729-bf98-490c-989d-5621e3b48139",
"IDString": "1_1"
},
"Attributes": [],
"FileAttributes": null,
"FileChangeAttributes": null,
"CreatedByID": {
"_id": 1,
"_server_id": 1,
"_server_guid": "b993c729-bf98-490c-989d-5621e3b48139",
"IDString": "1_1"
},
"CreatedOn": "2024-12-17T22:52:14.48",
"InheritsPermissions": true,
"UpdatedOn": "0001-01-01T00:00:00",
"FolderType": 0,
"ActiveCheckout": null,
"HasSubFolders": true,
"Has12dProjects": false,
"IsManagedFolder": false,
"NoOfSubFolders": 2,
"NumberOf12dProjects": 0,
"FolderState": 0,
"InheritsFileAttributes": false,
"InheritsFileNamingRules": true,
"LockInfo": null,
"Type": 1,
"Path": null,
"EntityObject": null
}
],
"Sub12dProjects": [],
"Forums": []
}