Accounts API



Die Accounts API is designed to create, delete and modify user accounts. 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 Accounts API

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

Example

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

It is required to authenticate as an administrative user when using the Accounts API.

Overview

Actions supported by the Accounts API

Action: getInfo

This action returns basic information about an account. Existing accounts will be searched by ID first, then by username and then by email.

ParameterRequiredDescriptionExample
actionYesMust always be getInfo.getInfo
username, nameYes*The username / email of the user.user@example.com
IDYes*The universal unique ID of the account. ID will be used to resolve/create the user account. Can be any external ID if unique.PME2myo2355sRegfgKk8m0YdA
emailYes*Any email address of the account. Can be a comma separated list to search by multiple emailsemail@address.com

 * At least one identifier needs to be passed to the API call.


Example for v11:

https://powerfolder.example.com/api/accounts?action=getInfo&username=user@example.com


Example for v14:

https://powerfolder.example.com/api/accounts?action=getInfo&name=user@example.com


 

Return value
{
  "ID":"TruJsi69ag6ar2fVC1SF",
  "username":"user@example.com",
  "lastLogin":null,
  "created":"2012-02-13 03:11:37.725",
  "validTill":"2013-10-30 10:11:33.725",
  "notes":"Example Note",
  "custom1":"Custom field 1",
  "custom2":"Custom field 2",
  "custom3":"Custom field 3",
  "nFolder":2,
  "nFolderOwner":1,
  "spaceAllowed":5368709120,
  "spaceUsed":514229,
  "devicesAllowed":8,
  "devicesUsed":2,
  "serverID":"6bzY8niQKaNEg7xGnog",
  "firstname":"David",
  "surname":"Stone",
  "telephone":"+492133111111",
  "ldapDN":"cn=David Stone,cn=Users,dc=example,dc=com",
  "shibbolethPersistentID":"https://idptest.idporganiztation.edu/idp/shibboleth!https://sptest.sporganization.edu/shibboleth/!EDWMDeuFECXwZbTMea0Guu3ntJ4=",
  "emails":["user@example.com","personal@example.org","no-reply@example.com"],
  "basePath":"/mnt/data_extra/username@example.com"
 }
Result KeyDescriptionExample
IDAccount ID3GYXgyusXuNoHd88qgWp
usernameAccount usernameuser@example.com
createdDate the account was created2011-02-13 03:11:37.725
lastLogin

The last login date

Only visible after the user has been logged in already.

2012-02-13 03:11:37.725
validTill

The date until this account is valid

Only visible when a value got set.

2013-10-30 10:11:33.725
notesCustom text notesThis user is valueable.
custom1

Custom text field 1

Only visible when a value got set.

1234567890
custom2

Custom text field 2

Only visible when a value got set.

parent.user@example.com
custom3

Custom text field 3

Only visible when a value got set.

Another information from external system.
nFolderNumber of folders the account is member of8
nFolderOwnerNumber of folders the account is owner of2
spaceAllowedThe space allowed/quota for this account in bytes.5368709120
spaceUsedThe space/quota used by this account in bytes.514229
devicesAllowedThe number of devices this account can be used on.8
devicesUsedThe number of actual used devices by this account.2
serverIDThe ID of the server which serves this account.6bzY8niQKaNEg7xGnog
 v9 or later also supports: 

firstname

The first name of the user

Only visible when a value got set.

David
surname

The surname of the user

Only visible when a value got set.

Rock

telephone

The mobile phone number of the user

Only visible when a value got set.

+492133111111

ldapDN

LDAP/Active directory distinguished name

Only visible for LDAP users

cn=David Stone,cn=Users,dc=example,dc=com

shibbolethPersistentID

Shibboleth persistent-id

Only visible for shibboleth users

https://idptest.idporganiztation.edu/idp/shibboleth!https://sptest.spo...

emails

Array of eEmail address(es) of the user

Only visible when a value got set.

[email@host.com, second@email.com]

basePath

The path on the storage, where the folders of the user reside.

Only visible after the user has been logged in already.

/mnt/data_extra/userx/
displayNameThe Name that gets displayed in the accounts overviewDavid Rock
languageThe language that got set for the user accounten
inFederationShows if this is a federated accountfalse
hasToSAgreedShows if the user agreed to the most recent version of the terms of service.

Action: getFolderPermissions

This action returns information about the folders and permissions of an account. Existing accounts will be search by ID first and then username.

ParameterMandatoryDescriptionExample
actionYesMust always be "getFolderPermissions"getFolderPermissions
usernameYesThe username / email of the user.user@example.com
IDNoThe universal unique ID of the account. ID will be used to resolve/create the user account. Can be any external ID if unique.PME2myo2355sRegfgKk8m0YdA


Example

https://powerfolder.example.com/api/accounts?action=getFolderPermissions&username=user@example.com

 

Return value
{
  "ResultSet":{
     "Result":[
        {
           "folderID":"5LhiBzxp9Uz5698n339Y",
           "folderName":"Documents",
           "permission":"OWNER",
           "resourceURL":"https://powerfolder.example.com/files/NUxoaUJ6eHA5VXo1Njk4bjMzOVk="
        },
        {
           "folderID":"UhpBitrekB9Tk3z1gSVz",
           "folderName":"Project 987",
           "permission":"ADMIN",
           "resourceURL":"https://powerfolder.example.com/files/VWhwQml0cmVrQjlUazN6MWdTVno="
        },
        {
           "folderID":"HK6gWAX1BVKYFm4UN82i",
           "folderName":"Sales Material",
           "permission":"READ",
           "resourceURL":"https://powerfolder.example.com/files/SEs2Z1dBWDFCVktZRm00VU44Mmk="
        }
     ]
  }
}
Result keyDescriptionExample
folderIDFolder IDUhpBitrekB9Tk3z1gSVz
folderNameName of the folderSales Material
permission

The permission on that folder. Available permissions:

  • NO_ACCESS
  • READ
  • READ_WRITE
  • ADMIN
  • OWNER
ADMIN
resourceURLThe URL the folder is available at.https://powerfolder.example.com/files/VWhwQml0cmVrQjlUazN6MWdTVno=

Action: store

This action is for creating or changing user account. If the user account doesn't exists it will be created. If an existing user account is found, it will be updated with the new values. Existing accounts will be searched by ID first and then username.

ParameterMandatoryDescriptionExample
actionYesMust always be "store"store
usernameYes if ID is emptyThe username / email of the user.user@example.com
IDYes if username is emptyThe universal unique ID of the account. Will use this ID to resolve/create the user account. Can be any external ID if unique.PME2myo2355sRegfgKk8m0YdA
passwordNoThe password to set.§ac0mpl3x_p4ssw0rd!
notesNoThe notes to setThis is a example note.
custom1NoCustom text/id/external information 134656644
custom2NoCustom text/id/external information 2Random third-party information
custom3NoCustom text/id/external information 3another.user@example.com
spaceAllowedNoThe space/quota for this user in bytes. "9999" for unlimited5368709120
devicesAllowedNoThe maximum number of allowed devices to license. "999" for unlimited.1
validTillNoThe date to which the user account is valid. In ISO format DD-MMM-YYYY.21-DEC-2012
serverIDNoThe ID of the server in cluster the user will always be served by statically. If omitted, a appropriate server is automatically chosen.6bzY8niQKaNEg7xGnog
   v9 or later also supports: 

firstname

NoThe first name of the userDavid
surnameNoThe surname of the userRock
emailsNoThe emails of the user account. Multiple emails can be separated by comma (,). Will try to resolve any existing accounts by thismail@anorganization.org, secondmail@test.de

telephone

NoThe mobile phone number of the user+492133111111

ldapDN

No

LDAP/Active directory distinguished name

cn=David Stone,cn=Users,dc=example,dc=com

shibbolethPersistentID

No

Shibboleth persistent-id

https://idptest.idporganiztation.edu/idp/shibboleth!https://sptest.spo...
  v9.4 or later also supports: 
organizationIDNoThe organizationID of the account
0B5DA216628547228F23187C17AD5407

basePath

No

The path on the storage, where the data of this user should resides. Does not migrate existing files and folders when changed./mnt/data_extra/userx/


Example

https://powerfolder.example.com/api/accounts?action=store&username=user@example.com&password=newpassword&spaceBytes=5368709120&licenseDevices=5

 

Return value
{
 "ID":"PME2myo2355sRegfgKk8m0YdA",
 "username":"user@example.com",
 "message":"Successfully stored user"
}

Action: delete

This feature was added in version 9.3 SP 3 of PowerFolder Server

 

For deleting a single user account and its owned folder.

ParameterMandatoryDescriptionExample
actionYesMust always be "delete"delete
IDYesThe universal unique ID of the account.PME2myo2355sRegfgKk8m0YdA


Example

https://powerfolder.example.com/api/accounts?action=delete&ID=PME2myo2355sRegfgKk8m0YdA

 

Return value
{
 "message": "Successfully deleted account",
 "username": "testuser",
 "ID": "PME2myo2355sRegfgKk8m0YdA"
}

Action: grant

For granting extra user permissions when using Extended Security Control.

ParameterMandatoryDescriptionExample
actionYesMust always be "grant"grant
usernameYes, if "ID" is missingThe username / email of the user.user@example.com
IDYes, if "username" missingThe universal unique ID of the account.PME2myo2355sRegfgKk8m0YdA
permissionIDYes

The permission to grant. Multiple values are allowed. Permissions available:

  • FolderCreate
  • FolderRemove
  • ChangePreferences
  • ChangeTransferMode
  • OrganizationCreate
FolderCreate


Example

https://powerfolder.example.com/api/accounts?action=grant&username=user@example.com&permissionID=FolderCreate&permissionID=ChangePreferences

 

Return value
{
 "ID":"PME2myo2355sRegfgKk8m0YdA",
 "username":"user@example.com",
 "message":"user@example.com granted FolderCreatePermission"
}

Action: revoke

For revoking extra user permissions when using Extended Security Control.

ParameterMandatoryDescriptionExample
actionYesMust always be "revoke"revoke
usernameYes, if "ID" is missingThe username / email of the user.user@example.com
IDYes, if "username" missingThe universal unique ID of the account.PME2myo2355sRegfgKk8m0YdA
permissionIDYes

The permission to revoke. Multiple values are allowed. Permissions available:

  • FolderCreate
  • FolderRemove
  • ChangePreferences
  • ChangeTransferMode
  • OrganizationCreate
FolderCreate


Example

https://powerfolder.example.com/api/accounts?action=revoke&username=user@example.com&permissionID=FolderCreate&permissionID=ChangePreferences

 

Return value
{
 "ID":"PME2myo2355sRegfgKk8m0YdA",
 "username":"user@example.com",
 "message":"user@example.com revoked FolderCreatePermission"
}

Action: getLoginURL

Retrieves an auto-login URL for an user account e.g. for single sign-on from other web portals or pages.

Please read the documentation related to the Login Callback API.

ParameterMandatoryDescriptionExample
actionYesMust always be "getLoginURL"getLoginURL
usernameYesThe username / email of the user.user@example.com
IDNoThe universal unique ID of the account. Will use this ID to resolve/create the user account. Can be any external ID if unique.PME2myo2355sRegfgKk8m0YdA
passwordYesThe password/credentials of that user account.3 chicken ate my bag


Example

https://powerfolder.example.com/api/accounts?action=getLoginURL&username=user@example.com&password=3%20chicken%20ate%20my%20bag

 

Return value
{
 "ID":"PME2myo2355sRegfgKk8m0YdA",
 "username":"user@example.com",
 "loginURL":"https://powerfolder.example.com/login?Username=user@example.com&PasswordOBF=GAlIQUJIQE5DWAlKXQlGUglOTEw%3D"
}

Action: getAccounts

Get a full list of all accounts.

ParameterMandatoryDescriptionExample
actionYesMust always be "getAccounts"getAccounts
pageSizeYesThe number of entries per page25
pageNumberYesThe number of the page to retrieve4
sortPropertyNoSorting is possible by Username name and Organization OID orgorg
sortOrderNoSorting order ascending asc or descending descdesc
filterByPermissionNo

Retrieve accounts that have a certain permission

Since: 11.0

(warning) Deprecated since 11.4 – use permission instead

AdminPermission
permissionNo

Filter accounts by permission. Passing this parameter multiple times is supported!

Since: 11.4

AdminPermission
organizationIDNo

Filtering accounts by membership of organization

Since: 11.3

TVD8LaCbpvx3NJH8SCDx
restrictOrgOIDNo

Filtering accounts by membership of organization

(warning) Deprecated since: 11.3 – use organizationOID instead

TVD8LaCbpvx3NJH8SCDx


Example

https://powerfolder.example.com/api/accounts?action=getAccounts

 

Return value
{
  "ResultSet":{
     "Result":[
		{
		  "ID":"TruJsi69ag6ar2fVC1SF",
		  "username":"user1@example.com",
		  "lastLogin":null,
		  "created":"2012-02-13 03:11:37.725",
		  "validTill":"2013-10-30 10:11:33.725",
		  "notes":"Example Note",
		  "custom1":"Custom field 1",
		  "custom2":"Custom field 2",
		  "custom3":"Custom field 3",
		  "nFolder":2,
		  "nFolderOwner":1,
		  "spaceAllowed":5368709120,
		  "spaceUsed":514229,
		  "devicesAllowed":8,
		  "devicesUsed":2,
		  "serverID":"6bzY8niQKaNEg7xGnog",
          "firstname":"David",
          "surname":"Stone",
          "telephone":"+492133111111",
          "ldapDN":"cn=David Stone,cn=Users,dc=example,dc=com",
          "shibbolethPersistentID":"https://idptest.idporganiztation.edu/idp/shibboleth!https://sptest.sporganization.edu/shibboleth/!EDWMDeuFECXwZbTMea0Guu3ntJ4="
        },
		{
		  "ID":"FJsdfj093jkf3j3ijf3l",
		  "username":"user2@example.com",
		  "lastLogin":null,
		  "created":"2012-02-13 03:11:37.725",
		  "validTill":"2013-10-30 10:11:33.725",
		  "notes":"Example Note",
		  "custom1":"Custom field 1",
		  "custom2":"Custom field 2",
		  "nFolder":2,
		  "nFolderOwner":1,
		  "spaceAllowed":5368709120,
		  "spaceUsed":514229,
		  "devicesAllowed":8,
		  "devicesUsed":2,
		  "serverID":"6bzY8niQKaNEg7xGnog"
		}
	]}
}

Action: merge

Using this API call you can merge one or more accounts into a single account.

This feature was added in version 11.2 SP 2 of PowerFolder Server

ParameterRequiredDescriptionExample
actionYesMust always be merge.merge
usernameYes*The username of the user.user@example.com
IDYes*The universal unique ID of the account. ID will be used to resolve/create the user account. Can be any external ID if unique.PME2myo2355sRegfgKk8m0YdA
mergeIDYes†The ID of an account to be merged into the account specified by ID or username.3GYXgyusXuNoHd88qgWp
 
mergeUsernameYes†The username of an account to be merged into the account specified by ID or username.  merge@example.org

 * At least one identifier needs to be passed to the API call.

 † At least one identifier needs to be passed to the API call. Both mergeID and mergeUsername can be mixed and specified multiple times in one call. You must NOT pass the mergeID AND the mergeUsername of the same account!


Example
https://powerfolder.example.com/api/accounts?action=merge&ID=PME2myo2355sRegfgKk8m0YdA&mergeUsername=merge@example.com&mergeID=Wni7DFkmdySELqBdsUs8

 

Return value
{
    "message": "Successfully merged accounts."
    "ID": "PME2myo2355sRegfgKk8m0YdA", 
}

Action: setJSON

This call is available since PowerFolder Server version 11.2

Using this action you can store custom data as key value pairs to a JSON field of the account. To do so any HTTP parameter added to the call of this API endpoint except action and ID will be added to the custom data.

ParameterMandatoryDescriptionExample
actionYesMust always be setJSON.setJSON
IDYesThis is the ID of the accountWni7DFkmdySELqBdsUs8

Example

http://powerfolder.example.com/api/accounts?action=setJSON&ID=Wni7DFkmdySELqBdsUs8&isBusiness=true&foo=bar


Return value
{
	"information":{"isBusiness":"true", "foo":"bar"},
	"ID":"Wni7DFkmdySELqBdsUs8",
	"message":"Added information to Account"
}

Action: removeJSON

This call is available since PowerFolder Server version 11.2

Using this action you can remove custom data from the JSON field of the account. To do so any HTTP parameter's key (name) added to the call of this API endpoint except action and OID will be removed from the custom data.

ParameterMandatoryDescriptionExample
actionYesMust always be removeJSON.

removeJSON

OIDYesThis is the ID of the account.Wni7DFkmdySELqBdsUs8

Example

http://powerfolder.example.com/api/accounts?action=removeJSON&ID=Wni7DFkmdySELqBdsUs8&isBusiness=


Return value
{
	"information":{"foo":"bar"},
	"OID":"Wni7DFkmdySELqBdsUs8",
	"message":"Removed information from Organization"
}

Action: setActivationDate

This call is available since PowerFolder Server version 11.6

ParameterMandatoryDescriptionExample
actionYesMust always be setActivationDate.
  • setActivationDate
  • setActivationDateAll
IDYes *This is the ID of the account.Wni7DFkmdySELqBdsUs8
dateNoThe activation date to be set.

If date is blank the today's date will be set.

dd.MM.yyyy


When using the action "setActivationDateAll" is used no ID is required and the date gets set to the current or chosen date.

Example

http://powerfolder.example.com/api/accounts?action=setActivationDate&ID=Wni7DFkmdySELqBdsUs8&date=02.03.2018

OR

http://powerfolder.example.com/api/accounts?action=setActivationDate&ID=Wni7DFkmdySELqBdsUs8


Return value
{"message":"Successfully set activation date."}

Action: correctStoragePath

This call is available since PowerFolder Server version 11.4

ParameterMandatoryDescriptionExample
actionYesMust always be correctStoragePath.

correctStoragePath

IDYesThis is the ID of the account.Wni7DFkmdySELqBdsUs8
usernameYesThis is the username of the accountTheUserName

Example

http://powerfolder.example.com/api/accounts?action=correctStoragePath&ID=Wni7DFkmdySELqBdsUs8

OR

http://powerfolder.example.com/api/accounts?action=correctStoragePath&username=TheUserName


Return value
{"message":"Successfully corrected all storage paths."}
{"lastLogin":"2017-12-01 15:19:49.0","spaceAllowed":0,"notes":"","created":"2017-12-01 14:42:58.0","displayName":"test2","spaceUsed":0,"language":"en","serverID":"qapfdd05","nFolderOwner":0,"hasToSAgreed":true,"devicesUsed":0,"nFolder":0,"devicesAllowed":999,"basePath":"/home/adama/clusterstorage1/test2","ID":"DB7D433B46844035B0A7E3E23006ECBC","inFederation":false,"username":"test2"}

Action: findDuplicatesInFederation

The API call returns a list of mailaddresses that are used on the local service and are existing on other federated services too.

Caution: This API call might take a long time untill it finishes since every account has to get checked.

ParameterMandatoryDescriptionExample
actionYesMust always be findDuplicatesInFederationfindDuplicatesInFederation


http://powerfolder.example.com/api/accounts?action=findDuplicatesInFederation