Folders API

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

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

Using the Folders API

The service is reachable at the URI: /api/folders

Example

https://powerfolder.example.com/api/folders

Depending on the action It's required to authenticate as admin or regular user when using the Folders API.

Overview

Actions supported by the Folders API

Action: create

This action is for creating and setting up a folder on the server. It's possible to create a completely new folder or let the server sync a folder which already exists on a client or on a different server (by folder ID).

 

ParameterMandatoryDescriptionExample
actionYesMust always be "create"create
nameYesThe name of the folderSales Material
IDNoThe ID of the folder. Will take the existing folder with that ID if available.[PME2myosRegfgKk8m0YdIA]
pathNoThe physical path to store the folder to. The calling user requires admin permission.D:\Data\Sales Material
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


Example

https://powerfolder.example.com/api/folders?action=create&name=Sales%20Material&path=D%3A%5CData%5CSales%20Material

 

Return value
{
 "ID":"[PME2myosRegfgKk8m0YdIA]",
 "message":"Successfully created folder Sales Material"
}

Action: delete

This action is for deleting a folder and removing all user's permissions from it.

ParameterMandatoryDescriptionExample
actionYesMust always be "delete"delete
nameNoThe name of the folderSales Material
deleteDataNo1 or 0. If the data should be physically deleted on disk. Yes by default.1
IDYesThe ID of an existing folder.[PME2myosRegfgKk8m0YdIA]


Example

https://powerfolder.example.com/api/folders?action=delete&ID=%5BPME2myosRegfgKk8m0YdIA%5D


Return value
{
 "ID":"[PME2myosRegfgKk8m0YdIA]",
 "message":"Successfully deleted folder Sales Material. Removed 3 members."
}

Action: setPermission

This action is for adding and removing users to/from a folder. With this method it is also possible to change access permission of users on folders. Does NOT sent an invitation E-Mail!

(warning) Make sure to URL-encode the parameter values.

ParameterMandatoryDescriptionExample
actionYesMust always be "setPermission"setPermission
IDYesThe ID of the folder.[PME2myosRegfgKk8m0YdIA]
nameNoThe name of the folder.If two folders with the same name exists, e.g. "Documents", PowerFolder will use only one of those folders. Therefore it is recommend to pass the unique folder "ID" to distinguish the folders.Sales Material
usernameYesThe existing username/email to apply the permissions to.user@example.com
createAccountNoSould a new account be created if it not yet exists?1
permissionYesThe permission to set. Must be one of these values: NO_ACCESS, READ, READ_WRITE, ADMIN or OWNERREAD


Example

https://powerfolder.example.com/api/folders?action=setPermission&username=user%40example.com&ID=%5BPME2myosRegfgKk8m0YdIA%5D&permission=READ

 

Return value
{
 "message":"Set new permission for user@example.com on Sales Material to READ",
 "ID":"[PME2myosRegfgKk8m0YdIA]"
}

Action: invite

Since 11.2

This action invites a user to a folder. An invitation E-Mail is sent to the user.

(warning) Make sure to URL-encode the parameter values.

ParameterMandatoryDescriptionExample
actionYesMust always be "invite"invite
IDYesThe ID of the folder.[PME2myosRegfgKk8m0YdIA]
usernameYesThe existing username/email of the user to inviteuser@example.com
createAccountNoSould a new account be created if it not yet exists?1
permissionYesThe permission to be set. Must be one of the following: READ, READ_WRITE, ADMIN or OWNERREAD

Example

https://powerfolder.example.com/api/folders?action=invite&username=user%40example.com&ID=%5BPME2myosRegfgKk8m0YdIA%5D&permission=READ


Return value
{
 "message":"Send invite to user@example.com for Sales Material to grant READ",
 "ID":"[PME2myosRegfgKk8m0YdIA]"
}

Action: getInfo

This action returns some general information about a folder.

ParameterMandatoryDescriptionExample
actionYesMust always be "getInfo"getInfo
IDYesThe ID of the folder.[PME2myosRegfgKk8m0YdIA]


Example

https://powerfolder.example.com/api/folders?action=getInfo&ID=%5BPME2myosRegfgKk8m0YdIA%5D


If there is no Link to the folder, the values "link" and "isPublic" are not returned. You can create a Link using the File Link API.


Return value
{
  "ID":"[PME2myosRegfgKk8m0YdIA]",
  "name":"Sales Documents",
  "basePath":"/storage/Sales Documents",
  "link":"https://powerfolder.example.com/getlink/fiVej3G7AL553BthR8FJyoVK/",
  "isPublic":true
}

Action: getAccounts

This action returns all users accounts of a folder. 

ParameterMandatoryDescriptionExample
actionYesMust always be "getAccounts"getAccounts
IDYesThe ID of the folder.[PME2myosRegfgKk8m0YdIA]
nameNoThe name of the folder. For logging purposes.Sales Material


Example

https://powerfolder.example.com/api/folders?action=getAccounts&ID=%5BPME2myosRegfgKk8m0YdIA%5D

 

Return value
{
  "ResultSet":{
     "Result":[
        {
           "ID":"3GYXgyusXuNoHd88qgWp",
           "username":"manager@example.com",
           "permission":"OWNER"
        },
        {
           "ID":"Tb2yMiAx3CuRrqMeccHh",
           "username":"employee@example.com",
           "permission":"ADMIN"
        },
        {
           "ID":"Xr2Ajd235MeccHh",
           "username":"customer@example.net",
           "permission":"READ"
        }
     ]
  }
}
Result keyDescriptionExample
IDAccount ID3GYXgyusXuNoHd88qgWp
usernameAccount usernameuser@example.com
permissionThe permission on the folder. NO_ACCESS, READ, READ_WRITE, ADMIN or OWNERREAD_WRITE

Action: removeAllAccounts

This action will remove all users from a folder, by revoking their access permissions including the owner. It will not remove the folder itself.

(warning) Make sure to URL-encode the parameter values.

ParameterMandatoryDescriptionExample
actionYesMust always be "removeAllAccounts"removeAllAccounts
IDYesThe ID of the folder.[PME2myosRegfgKk8m0YdIA]
nameNoThe name of the folder. For logging purposes.Sales Material


Example

https://powerfolder.example.com/api/folders?action=removeAllAccounts&ID=%5BPME2myosRegfgKk8m0YdIA%5D

 

Return value
{
"message":"Revoked all permissions for 3 users on folder Sales Material",
"ID":"[PME2myosRegfgKk8m0YdIA]"
}

Action: rename

This action will rename a Folder specified by its ID to the given name.

(warning) Make sure to URL-encode the parameter values.

ParameterMandatoryDescriptionExample
actionYesMust always be "rename"rename
IDYesThe ID of the folder.[PME2myosRegfgKk8m0YdIA]
newNameYesThe new name of the folder.Sales Material


Example

https://powerfolder.example.com/api/folders?action=rename&ID=%5BPME2myosRegfgKk8m0YdIA%5D&newName=Sales%20Material


Return Value

Return value
{
"message":"Folder successfully renamed",
"newName":"Sales Material"
}