This tutorial demonstrates on how to get folder files via RESTful API.
The steps include:
Getting folder items using the folder 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 folder files
This request can be found in the API documentation under Folders marked 'Get folder files'
Sample Request
curl --location 'http://{your-server-here}/api/v1/folders/{folder-id}/files?retrieve_attributes=true&page=1&filter=ascending&show_deleted_files=true' \
--header 'Authorization: Bearer <your-token-here>' \
--header 'Content-Type: application/json'
Parameters:
retrieve_attributes - can be set true or false
page - page number returned
page_size - number of items per page
filter - Filters the result. (OPTIONAL)
show_deleted_files - can be set true or false
Below is a sample response for a specific folder and files inside it. Click in the line below to see the code.
Sample Response
{
"PageNumber": 1,
"PageSize": 5,
"TotalRows": 2,
"TotalPages": 1,
"Result": [
{
"ID": {
"_id": 170164,
"_server_id": 1,
"_server_guid": "b993c729-bf98-490c-989d-5621e3b48139",
"IDString": "170164_1"
},
"FileName": "random file.txt",
"DisplayName": null,
"FolderID": {
"_id": 170097,
"_server_id": 1,
"_server_guid": "b993c729-bf98-490c-989d-5621e3b48139",
"IDString": "170097_1"
},
"State": "None",
"LastChangeType": 1,
"LastChangedBy": "",
"LastChangedTime": "2025-03-25T06:08:51.547",
"IsCheckedOut": false,
"LastModified": "2025-03-25T06:08:50.983",
"CreatedOn": "2025-03-25T06:08:50.983",
"Path": "Test/random file.txt",
"LatestVersion": 1,
"SizeReadable": "12B",
"Size": 12,
"ActiveCheckout": null,
"ActiveFolderCheckout": null,
"FileType": "TXT File",
"FileIcon": "",
"HasReferences": false,
"IsLinked": false,
"LinkedPath": "",
"Attributes": null,
"ChangeAttributes": null,
"EntityObject": null,
"ActiveMs365Session": null
},
{
"ID": {
"_id": 170163,
"_server_id": 1,
"_server_guid": "b993c729-bf98-490c-989d-5621e3b48139",
"IDString": "170163_1"
},
"FileName": "a1.txt",
"DisplayName": null,
"FolderID": {
"_id": 170097,
"_server_id": 1,
"_server_guid": "b993c729-bf98-490c-989d-5621e3b48139",
"IDString": "170097_1"
},
"State": "None",
"LastChangeType": 2,
"LastChangedBy": "",
"LastChangedTime": "2025-03-25T14:45:15.293",
"IsCheckedOut": false,
"LastModified": "2025-03-25T14:45:13.143",
"CreatedOn": "2025-03-25T06:08:50.98",
"Path": "Test/Folder 1/a1.txt",
"LatestVersion": 2,
"SizeReadable": "11B",
"Size": 11,
"ActiveCheckout": null,
"ActiveFolderCheckout": null,
"FileType": "TXT File",
"FileIcon": "",
"HasReferences": false,
"IsLinked": false,
"LinkedPath": "",
"Attributes": [
{
"auto_increment_start": 1,
"description": "",
"enum_items": null,
"input_mask": "",
"is_auto_increment": false,
"is_visible": true,
"optional": false,
"order": 0,
"read_only": false,
"reprompt_on_change": false,
"type": 0,
"value": {
"_value": "12d Synerrgy",
"enum_id": null,
"value_id": {
"_id": 160018,
"_server_id": 1,
"_server_guid": "b993c729-bf98-490c-989d-5621e3b48139",
"IDString": "160018_1"
}
},
"visibility_constraint": null,
"workflow_id": null,
"attribute_id": {
"_id": 1,
"_server_id": 1,
"_server_guid": "b993c729-bf98-490c-989d-5621e3b48139",
"IDString": "1_1"
},
"name": "To",
"display_name": "To",
"id": {
"_id": 1,
"_server_id": 1,
"_server_guid": "b993c729-bf98-490c-989d-5621e3b48139",
"IDString": "1_1"
}
},
{
"auto_increment_start": 1,
"description": "",
"enum_items": null,
"input_mask": "",
"is_auto_increment": false,
"is_visible": true,
"optional": false,
"order": 0,
"read_only": false,
"reprompt_on_change": false,
"type": 1,
"value": {
"_value": 1234,
"enum_id": null,
"value_id": {
"_id": 160019,
"_server_id": 1,
"_server_guid": "b993c729-bf98-490c-989d-5621e3b48139",
"IDString": "160019_1"
}
},
"visibility_constraint": null,
"workflow_id": null,
"attribute_id": {
"_id": 6,
"_server_id": 1,
"_server_guid": "b993c729-bf98-490c-989d-5621e3b48139",
"IDString": "6_1"
},
"name": "Attachments",
"display_name": "Attachments",
"id": {
"_id": 6,
"_server_id": 1,
"_server_guid": "b993c729-bf98-490c-989d-5621e3b48139",
"IDString": "6_1"
}
}
],
"ChangeAttributes": null,
"EntityObject": null,
"ActiveMs365Session": null
}
]
}