Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

The Folders API is designed to create, delete and configure folders. It's also possible to change the access permissions of users to folders.

Note

This API is available from version 11.3 or above of PowerFolder server.


Info

Please read the main article about the API to understand how it works.

Using the Files API

The service is reachable at the URI: /api/files/<folderID base64 encoded>

Example

https://powerfolder.example.com/api/files/UEItUlNXRVZoVGRRN0UxaWJFUnFhalktJHBlcnNvbmFsX2ZpbGVz

Info

It is necessary to log in as the user whose folder you want to restore.


Info
titlebase64

This ID encoded in base64 is shown in the address line in browser when accessing a folder with a browser.



Panel
titleOverview

Table of Contents



Actions supported by the Files API

Action: getAll

This action returns all files of a the specified folder and subdirectory.

ParameterMandatoryDescriptionExample
actionYesMust always be "getAll"getAll
folder IDYesThe ID of the folder encoded in base64.UEItUlNXRVZoVGRRN0UxaWJFUnFhalktJHBlcnNvbmFsX2ZpbGVz
subdirectoryNoThe 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.

ParameterMandatoryDescriptionExample
actionYesMust always be "exists"exists
folder IDYesThe ID of the folder encoded in base64.UEItUlNXRVZoVGRRN0UxaWJFUnFhalktJHBlcnNvbmFsX2ZpbGVz
subdirectoryNoThe 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.


ParameterMandatoryDescriptionExample
actionYesMust always be "createsubdir"createsubdir
folder IDYesThe ID of the folder encoded in base64.UEItUlNXRVZoVGRRN0UxaWJFUnFhalktJHBlcnNvbmFsX2ZpbGVz
dirNameYesThe name of the new subdirectorythesis




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. (warning)(warning) This action is done recursivly for directories.

ParameterMandatoryDescriptionExample
actionYesMust always be "delete"delete
folder IDYesThe ID of the folder encoded in base64.UEItUlNXRVZoVGRRN0UxaWJFUnFhalktJHBlcnNvbmFsX2ZpbGVz
dirNameYesThe 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. 


ParameterMandatoryDescriptionExample
actionYesMust always be "restore"restore
folder IDYesThe ID of the folder encoded in base64.UEItUlNXRVZoVGRRN0UxaWJFUnFhalktJHBlcnNvbmFsX2ZpbGVz
timestampFromNoThis is the start time from which the data will be restored. (Unix timestamp UTC in milliseconds)1497948858000
timestampToNo

This is the end time from which the data will be restored. (Unix timestamp UTC in milliseconds)

1497949951000
serverIDNoThe ID of the server in cluster the folder will be created on. If omitted the server which received the request will be used.6bzY8niQKaNEg7xGnog
overwriteNoIf 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&timestampFrom=1497948858000&timestampTo=1497949951000

Restoring all Files from a start time:

https://powerfolder.example.com/api/files/UEItUlNXRVZoVGRRN0UxaWJFUnFhalktJHBlcnNvbmFsX2ZpbGVz?action=restore&timestampFrom=1497948858000

Restoring all Files untill an ending time:

https://powerfolder.example.com/api/files/UEItUlNXRVZoVGRRN0UxaWJFUnFhalktJHBlcnNvbmFsX2ZpbGVz?action=restore&timestampTo=1497949951000