REST API Folders
Unlike other REST APIs, these use the file ID (found in the File Browser) or the UUID (found in all payloads or JSON representations) instead of the configuration ID.
The REST API for folders follows the best practices for RESTful API design. Make sure you read the HTTP status codes and interpret them together with the responses.
Note that overwrite functions adhere to the user’s existing permission settings.
- 1 Read the Root Folder
- 1.1 Description
- 1.2 URI syntax
- 1.3 Example response
- 2 Read the Folder
- 2.1 Description
- 2.2 URI syntax
- 2.3 Example response
- 3 Read Folder Permissions
- 3.1 Description
- 3.2 URI syntax
- 3.3 Example response
- 4 Read Group Permissions of a Folder
- 4.1 Description
- 4.2 URI syntax
- 4.3 Example response
- 5 Read Other Permissions of a Folder
- 5.1 Description
- 5.2 URI syntax
- 5.3 Example response
- 6 Read the Owner of a Folder
- 6.1 Description
- 6.2 URI syntax
- 6.3 Example response
- 7 Change the Owner of a Folder
- 7.1 Description
- 7.2 URI syntax
- 7.3 Verification
- 8 Create a Group Permission for a Folder
- 8.1 Description
- 8.2 URI syntax
- 8.3 Verification
- 9 Change Group Permission for a Folder
- 9.1 Description
- 9.2 URI syntax
- 9.3 Verification
- 10 Change Others Permission for a Folder
- 10.1 Description
- 10.2 URI syntax
- 10.3 Verification
- 11 Delete Group Permission of a Folder
- 11.1 Description
- 11.2 URI syntax
- 11.3 Verification
- 12 Download a Folder as a ZIP File
- 12.1 Description
- 12.2 URI syntax
- 12.3 Verification
- 12.4 Advanced parameters
- 12.4.1 Backup-ignoreDependencies
- 12.4.2 URI syntax
- 12.4.3 Backup-Skip
- 12.4.4 URI syntax
- 13 Download a Specific File as a ZIP File
- 13.1 Description
- 13.2 Preparation
- 13.3 URI syntax
- 13.4 Verification
- 14 Migrate/Restore a Folder from a ZIP File
- 14.1 Description
- 14.2 URI syntax
- 14.3 Verification
- 14.4 Restrictions & notes
- 14.5 Advanced parameters
- 14.5.1 Restore-Overwrite
- 14.5.2 URI syntax
- 14.5.3 Note
- 14.5.4 Restore-Skip
- 14.5.5 URI syntax
- 15 Back Up File or Folder with Permissions
- 15.1 Description
- 15.2 URI syntax
- 15.3 Restrictions & notes
- 16 Back Up File or Folder with Group Permissions
- 16.1 Description
- 16.2 URI syntax
- 17 Back Up File or Folder with File Sharing
- 17.1 Description
- 17.2 URI syntax
- 18 Back Up File or Folder with Owners
- 18.1 Description
- 18.2 URI syntax
- 19 Restore File or Folder Permissions
- 19.1 Description
- 19.2 URI syntax
- 19.3 Restrictions & notes
- 20 Restore File or Folder Group Permissions
- 20.1 Description
- 20.2 URI syntax
- 20.3 Advanced parameters
- 20.3.1 URI syntax
- 20.3.2 Note
- 21 Restore File or Folder with File Sharing
- 21.1 Description
- 21.2 URI syntax
- 22 Restore File or Folder with Owners
- 22.1 Description
- 22.2 URI syntax
- 22.3 Restrictions & notes
- 22.4 Advanced parameters
- 22.4.1 URI syntax
- 22.4.2 Note
To receive more meaningful HTTP errors for each call, you can add the following command after the username and password:
-w"\n%{http_code}\n"
Read the Root Folder
Request method - GET
Description
Returns a list of all the folders in the folder tree in Datameer.
URI syntax
curl -u '<username>:<password>' -X GET 'http://<Datameer-serverIP>:<port-number>/api/filesystem/root-folder'Example response
{
"name": "/",
"uuid": "f81eeb96-b675-4ace-878c-269962e03ca4",
"_links": {
"self": {
"href": "/api/filesystem/root-folder"
},
"permission": {
"href": "/api/filesystem/folders/1/permission"
}
},
"_embedded": {
"folders": [
{
"name": "Users",
"_links": {
"self": {
"href": "/api/filesystem/folders/3"
}
}
},
{
"name": "Data",
"_links": {
"self": {
"href": "/api/filesystem/folders/4"
}
}
},
{
"name": "Analytics",
"_links": {
"self": {
"href": "/api/filesystem/folders/10"
}
}
},
{
"name": "Visualization",
"_links": {
"self": {
"href": "/api/filesystem/folders/12"
}
}
},
{
"name": "Images",
"_links": {
"self": {
"href": "/api/filesystem/folders/14"
}
}
},
{
"name": ".system",
"_links": {
"self": {
"href": "/api/filesystem/folders/2"
}
}
},
{
"name": "Examples",
"_links": {
"self": {
"href": "/api/filesystem/folders/18"
}
}
}
]
}Read the Folder
Request method - GET
Description
Returns a list of the folder's content in Datameer.
URI syntax
curl -u '<username>:<password>' -X GET 'http://<Datameer-serverIP>:<port-number>/api/filesystem/folders/<file-id> or <uuid>'Example response
{
"name": "Data",
"uuid": "9e6635dd-d02d-4073-9e6e-123a31c46938",
"_links": {
"parent": {
"href": "/api/filesystem/folders/1"
},
"self": {
"href": "/api/filesystem/folders/4"
},
"permission": {
"href": "/api/filesystem/folders/4/permission"
}
},
"_embedded": {
"folders": [
{
"name": "Connections",
"_links": {
"self": {
"href": "/api/filesystem/folders/5"
}
}
},
{
"name": "ImportJobs",
"_links": {
"self": {
"href": "/api/filesystem/folders/6"
}
}
},
{
"name": "DataLinks",
"_links": {
"self": {
"href": "/api/filesystem/folders/7"
}
}
},
{
"name": "FileUploads",
"_links": {
"self": {
"href": "/api/filesystem/folders/8"
}
}
},
{
"name": "ExportJobs",
"_links": {
"self": {
"href": "/api/filesystem/folders/9"
}
}
}
]
}Read Folder Permissions
Request method - GET
Description
Returns a list of the folder's permissions in Datameer.
URI syntax
curl -u '<username>:<password>' -X GET 'http://<Datameer-serverIP>:<port-number>/api/filesystem/folders/<file-id> or <uuid>/permission'Example response
{
"others": {
"readable": true,
"writable": true
},
"owner": "admin",
"_links": {
"folder": {
"href": "/api/filesystem/folders/9e6635dd-d02d-4073-9e6e-123a31c46938"
},
"others": {
"href": "/api/filesystem/folders/9e6635dd-d02d-4073-9e6e-123a31c46938/permission/others"
},
"owner": {
"href": "/api/filesystem/folders/9e6635dd-d02d-4073-9e6e-123a31c46938/permission/owner"
},
"self": {
"href": "/api/filesystem/folders/9e6635dd-d02d-4073-9e6e-123a31c46938/permission"
},
"groups": {
"href": "/api/filesystem/folders/9e6635dd-d02d-4073-9e6e-123a31c46938/permission/groups"
}
}Read Group Permissions of a Folder
Request method - GET
Description
Returns a list of the folder's group permissions in Datameer.
URI syntax
curl -u '<username>:<password>' -X GET 'http://<Datameer-serverIP>:<port-number>/api/filesystem/folders/<file-id> or <uuid>/permission/groups'Example response
{
"_links": {
"self": {
"href": "/api/filesystem/folders/9e6635dd-d02d-4073-9e6e-123a31c46938/permission/groups"
},
"permission": {
"href": "/api/filesystem/folders/9e6635dd-d02d-4073-9e6e-123a31c46938/permission"
}
},
"_embedded": {
"groups": [
{
"flags": {
"readable": true,
"writable": true
},
"name": "dasuser",
"_links": {
"self": {
"href": "/api/filesystem/folders/9e6635dd-d02d-4073-9e6e-123a31c46938/permission/groups/dasuser"
},
"permission": {
"href": "/api/filesystem/folders/9e6635dd-d02d-4073-9e6e-123a31c46938/permission"
}
}
}
]
}Read Other Permissions of a Folder
Request method - GET
Description
Returns a list of the folder's permissions for others in Datameer.
URI syntax
curl -u '<username>:<password>' -X GET 'http://<Datameer-serverIP>:<port-number>/api/filesystem/folders/<file-id> or <uuid>/permission/othersExample response
{
"readable": true,
"writable": true,
"_links": {
"self": {
"href": "/api/filesystem/folders/9e6635dd-d02d-4073-9e6e-123a31c46938/permission/others"
},
"permission": {
"href": "/api/filesystem/folders/9e6635dd-d02d-4073-9e6e-123a31c46938/permission"
}
}Read the Owner of a Folder
Request method - GET
Description
Returns a list of the folder's owners in Datameer.
URI syntax
curl -u '<username>:<password>' -X GET 'http://<Datameer-serverIP>:<port-number>/api/filesystem/folders/<file-id> or <uuid>/permission/owner'Example response
{
"owner": "admin",
"_links": {
"self": {
"href": "/api/filesystem/folders/9e6635dd-d02d-4073-9e6e-123a31c46938/permission/owner"
},
"permission": {
"href": "/api/filesystem/folders/9e6635dd-d02d-4073-9e6e-123a31c46938/permission"
}
}Change the Owner of a Folder
Request method - PUT
Description
Changes the owner of folder in Datameer.
URI syntax
curl -u '<username>:<password>' -X PUT -H "Content-Type:application/json" -H "Accept: application/json" -d "{owner:<username>}" "http://
<Datameer-serverIP>:<port-number>/api/filesystem/folders/<file-id>/permission/owner"