Files API
Actions supported by the Files API
Action: getAll
This action returns all files of a the specified folder and subdirectory.
Parameter | Mandatory | Description | Example |
---|---|---|---|
action | Yes | Must always be "getAll" | getAll |
folder ID | Yes | The ID of the folder encoded in base64. | UEItUlNXRVZoVGRRN0UxaWJFUnFhalktJHBlcnNvbmFsX2ZpbGVz |
subdirectory | No | The subdirectory you want to list the files of. | 1970/thesis/images |
Example
https://powerfolder.example.com/api/files/UEItUlNXRVZoVGRRN0UxaWJFUnFhalktJHBlcnNvbmFsX2ZpbGVz/1970/thesis/images?action=getAll
https://powerfolder.example.com/api/files/UEItUlNXRVZoVGRRN0UxaWJFUnFhalktJHBlcnNvbmFsX2ZpbGVz?action=getAll
Action: exists
Check if the queried file or directory exists.
Parameter | Mandatory | Description | Example |
---|---|---|---|
action | Yes | Must always be "exists" | exists |
folder ID | Yes | The ID of the folder encoded in base64. | UEItUlNXRVZoVGRRN0UxaWJFUnFhalktJHBlcnNvbmFsX2ZpbGVz |
subdirectory | No | The file or directory you want to check. | 1970/thesis/images |
Example
https://powerfolder.example.com/api/files/UEItUlNXRVZoVGRRN0UxaWJFUnFhalktJHBlcnNvbmFsX2ZpbGVz/1970/thesis/images?action=exists
https://powerfolder.example.com/api/files/UEItUlNXRVZoVGRRN0UxaWJFUnFhalktJHBlcnNvbmFsX2ZpbGVz?action=exists
Action: createsubdir
This action allows a user to create a subdirectory if the user does have write permission to that Folder.
Parameter | Mandatory | Description | Example |
---|---|---|---|
action | Yes | Must always be "createsubdir" | createsubdir |
folder ID | Yes | The ID of the folder encoded in base64. | UEItUlNXRVZoVGRRN0UxaWJFUnFhalktJHBlcnNvbmFsX2ZpbGVz |
dirName | Yes | The name of the new subdirectory | thesis |
Example
https://powerfolder.example.com/api/files/UEItUlNXRVZoVGRRN0UxaWJFUnFhalktJHBlcnNvbmFsX2ZpbGVz/2018?action=createsubdir&dirName=thesis
Action: delete
This action deletes the file or directory specified in the URL. This action is done recursivly for directories.
Parameter | Mandatory | Description | Example |
---|---|---|---|
action | Yes | Must always be "delete" | delete |
folder ID | Yes | The ID of the folder encoded in base64. | UEItUlNXRVZoVGRRN0UxaWJFUnFhalktJHBlcnNvbmFsX2ZpbGVz |
dirName | Yes | The name of the file or directory to be deleted. | thesis |
Example
https://powerfolder.example.com/api/files/UEItUlNXRVZoVGRRN0UxaWJFUnFhalktJHBlcnNvbmFsX2ZpbGVz/thesis?action=delete
Action: restore
This action is for restoring data within a certain folder. It is possible to determine a time span for the files that shall be restored. All files that were deleted within this time span are restored.
Parameter | Mandatory | Description | Example |
---|---|---|---|
action | Yes | Must always be "restore" | restore |
folder ID | Yes | The ID of the folder encoded in base64. | UEItUlNXRVZoVGRRN0UxaWJFUnFhalktJHBlcnNvbmFsX2ZpbGVz |
timestampFrom | No | This is the start time from which the data will be restored. (Unix timestamp UTC in milliseconds) | 1497948858000 |
timestampTo | No | This is the end time from which the data will be restored. (Unix timestamp UTC in milliseconds) | 1497949951000 |
serverID | No | The ID of the server in cluster the folder will be created on. If omitted the server which received the request will be used. | 6bzY8niQKaNEg7xGnog |
overwrite | No | If the restore should overwrite existing files or only restore deleted non-existing files. | True |
Example
Resotring all Files:
https://powerfolder.example.com/api/files/UEItUlNXRVZoVGRRN0UxaWJFUnFhalktJHBlcnNvbmFsX2ZpbGVz?action=restore
Restoring all Files within a time span:
https://powerfolder.example.com/api/files/UEItUlNXRVZoVGRRN0UxaWJFUnFhalktJHBlcnNvbmFsX2ZpbGVz?action=restore×tampFrom=1497948858000×tampTo=1497949951000
Restoring all Files from a start time:
https://powerfolder.example.com/api/files/UEItUlNXRVZoVGRRN0UxaWJFUnFhalktJHBlcnNvbmFsX2ZpbGVz?action=restore×tampFrom=1497948858000
Restoring all Files untill an ending time:
https://powerfolder.example.com/api/files/UEItUlNXRVZoVGRRN0UxaWJFUnFhalktJHBlcnNvbmFsX2ZpbGVz?action=restore×tampTo=1497949951000