Accounts API

Accounts API

This content is archived.

 

 

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.

Parameter

Required

Description

Example

Parameter

Required

Description

Example

action

Yes

Must always be getInfo.

getInfo

username, name

Yes*

The username / email of the user.

user@example.com

ID

Yes*

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

email

Yes*

Any email address of the account. Can be a comma separated list to search by multiple emails

email@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 Key

Description

Example

Result Key

Description

Example

ID

Account ID

3GYXgyusXuNoHd88qgWp

username

Account username

user@example.com

created

Date the account was created

2011-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

notes

Custom text notes

This 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.

nFolder

Number of folders the account is member of

8

nFolderOwner

Number of folders the account is owner of

2

spaceAllowed

The space allowed/quota for this account in bytes.

5368709120

spaceUsed

The space/quota used by this account in bytes.

514229

devicesAllowed

The number of devices this account can be used on.

8

devicesUsed

The number of actual used devices by this account.

2

serverID

The 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/

displayName

The Name that gets displayed in the accounts overview

David Rock

language

The language that got set for the user account

en

inFederation

Shows if this is a federated account

false

hasToSAgreed

Shows 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.

Parameter

Mandatory

Description

Example

Parameter

Mandatory

Description

Example

action

Yes

Must always be "getFolderPermissions"

getFolderPermissions

username

Yes

The username / email of the user.

user@example.com

ID

No

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


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 key

Description

Example

Result key

Description

Example

folderID

Folder ID

UhpBitrekB9Tk3z1gSVz

folderName

Name of the folder

Sales Material

permission

The permission on that folder. Available permissions:

  • NO_ACCESS

  • READ

  • READ_WRITE

  • ADMIN

  • OWNER

ADMIN

resourceURL

The 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.

Parameter

Mandatory

Description

Example

Parameter

Mandatory

Description

Example

action

Yes

Must always be "store"

store

username

Yes if ID is empty

The username / email of the user.

user@example.com

ID

Yes if username is empty

The universal unique ID of the account. Will use this ID to resolve/create the user account. Can be any external ID if unique.

PME2myo2355sRegfgKk8m0YdA

password

No

The password to set.

§ac0mpl3x_p4ssw0rd!

notes

No

The notes to set

This is a example note.

custom1

No

Custom text/id/external information 1

34656644

custom2

No

Custom text/id/external information 2

Random third-party information

custom3

No

Custom text/id/external information 3

another.user@example.com

spaceAllowed

No

The space/quota for this user in bytes. "9999" for unlimited

5368709120

devicesAllowed

No

The maximum number of allowed devices to license. "999" for unlimited.

1

validTill

No

The date to which the user account is valid. In ISO format DD-MMM-YYYY.

21-DEC-2012

serverID

No

The 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

No

The first name of the user

David

surname

No

The surname of the user

Rock

emails

No

The emails of the user account. Multiple emails can be separated by comma (,). Will try to resolve any existing accounts by this

mail@anorganization.org, secondmail@test.de

telephone

No

The 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:

 

organizationID

No

The 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.

Parameter

Mandatory

Description

Example

Parameter

Mandatory

Description

Example

action

Yes

Must always be "delete"

delete

ID

Yes

The 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.

Parameter

Mandatory

Description

Example

Parameter

Mandatory

Description

Example

action