Organizations API


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

Using the Organizations API you can modify existing organiztaions.

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

Using the Organizations API

The service is available at the URI: /api/organizations

Example

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

Overview


Actions supported by the Organizations API

Action: create

This action returns the ID and the name of the created organization.

ParameterMandatoryDescriptionExample
actionYesMust always be createcreate
nameYesName of the new organizationPower


Example

https://powerfolder.example.com/api/organizations?action=create&name=Power


Return value
{
	"ID":"TVD8LaCbpvx3NJH8SCDx",
	"Name":"Blab"
}

Action: getInfo

This action returns several informations about a organization.

ParameterMandatoryDescriptionExample
actionYesMust always be getInfogetInfo
OIDYesOID of the organizationDveE4UFBVRgmvmHrGC1w


Example

https://powerfolder.example.com/api/organizations?action=getInfo&OID=DveE4UFBVRgmvmHrGC1w


Return value
{
	"id":"DveE4UFBVRgmvmHrGC1w",
	"maxUsers":15,
	"nUsers": 13,
	"name":"I am the name of an organization",
	"storageSize":53687091200,
	"storageUsed":26843545600,
	"notes":"I am a note",
	"domains":["example.com", "example.org"],
	"jsonData":{"isBusiness":"true"}
}

Action: getOrganizations

This action returns a list of organizations available on the server.

ParameterMandatoryDescriptionExample
actionYesMust always be getOrganizationsgetOrganizations
queryNoBeginning of the name of an organization to search forPower
adminAccountOIDNo

List all organizations the account is administrator of.

Since: 11.0

TruJsi69ag6ar2fVC1SF
adminAccountUsernameNo

List all organizations the account is administrator of.

Since: 11.0

orgadmin@example.org


Example

https://powerfolder.example.com/api/organizations?action=getOrganizations&query=Power

 

Return value
{
  "ResultSet":{
    "Result":[
      {
        "ID":"Aey7sUi7N4R9r5CZ6vxS",
        "name":"PowerFolder",
		"maxUsers: 10,
		"nUsers": 8,
        "notes":"Created in 2007"
      },
      {
        "ID":"Wni7DFkmdySELqBdsUs8",
        "name":"Power for Tomorrow",
		"maxUsers: 5,
		"nUsers": 2,
        "notes":"Sustainable Energy Solutions"
      }
    ]
  }
}

Action: rename

This action renames an organization.

ParameterMandatoryDescriptionExample
actionYesMust always be rename.

rename

OID

Yes

This is the ID of the organization to rename.Wni7DFkmdySELqBdsUs8
nameYesThe new name of the organization.Power of Tomorrow


Example

http://powerfolder.example.com/api/organizations?action=rename&OID=Wni7DFkmdySELqBdsUs8&name=Power%20of%20Tomorrow


Action: changeNotes

This action changes the notes of an organization.

ParameterMandatoryDescriptionExample
actionYesMust always be changeNotes.changeNotes
OIDYesThis is the ID of the organiztation to change the note.Wni7DFkmdySELqBdsUs8
notesNoThe notes to set for this organization.Sustainable Energy


Example

http://powerfolder.example.com/api/organizations?action=changeNotes&OID=Wni7DFkmdySELqBdsUs8¬es=Sustainable%20Energy


Action: changeSize

This action changes the storage size that can be distributed among the users.

ParameterMandatoryDescriptionExample
actionYesMust always be changeSize.changeSize
OIDYesThis is the ID of the organization to change the storage size.Wni7DFkmdySELqBdsUs8
storageSizeGBNoThe new storage size in giga byte. If it is not specified, the size is not limited.123


Example

http://powerfolder.example.com/api/organizations?action=changeSize&OID=Wni7DFkmdySELqBdsUs8&storageSizeGB=123


Action: changeValidFrom

This action changes the validity starting date of this organization.

ParameterMandatoryDescriptionExample
actionYesMust always be changeValidFrom.changeValidFrom
OIDYesThis is the ID of the organization to change the validity starting date.Wni7DFkmdySELqBdsUs8
OSValidFromNoThe new validity starting date of the organization. If it is not specified, the date is removed. The format of the date is "dd MMM yyyy".10 DEC 2013


Example

http://powerfolder.example.com/api/organizations?action=changeValidFrom&OID=Wni7DFkmdySELqBdsUs8&OSValidTill=10%20DEC%202010


Action: changeValidTill

This action changes the validity ending date of this organization.

ParameterMandatoryDescriptionExample
actionYesMust always be changeValidTill.changeValidTill
OIDYesThis is the ID of the organization to change the validity ending date.Wni7DFkmdySELqBdsUs8
OSValidTillNoThe new validity ending date of the organization. If it is not specified, the date is removed. The format of the date is "dd MMM yyyy".10 DEC 2013


Example

http://powerfolder.example.com/api/organizations?action=changeValidTill&OID=Wni7DFkmdySELqBdsUs8&OSValidTill=10%20DEC%202010


Action: changeMaxUsers

This action changes the number of maximum users allowed on the organization.

ParameterMandatoryDescriptionExample
actionYesMust always be changeMaxUsers.changeMaxUsers
OIDYesThis is the ID of the organization to change the maximum number of members allowed on the organization.Wni7DFkmdySELqBdsUs8
maxUsersYesThe new number of maximum users allowed on the organization.293


Example

http://powerfolder.example.com/api/organizations?action=changeMaxUsers&OID=Wni7DFkmdySELqBdsUs8&maxUsers=103

Action: addAdmin

This call is available since PowerFolder Server version 11.0

This action allows an administrator or a user with OrganizationCreatePermission and the specific OrganizationAdminPermission of that Organization to add Administrators to the Organization.

ParameterMandatoryDescriptionExample
actionYesMust always be changeMaxUsers.addAdmin
OIDYesThis is the ID of the organization to change the maximum number of members allowed on the organization.Wni7DFkmdySELqBdsUs8
accountIDYesThe ID of the account to grant the OrganizationAdminPermissionPME2myo2355sRegfgKk8m0YdA

 

Example

http://powerfolder.example.com/api/organizations?action=addAdmin&OID=Wni7DFkmdySELqBdsUs8&accountID=PME2myo2355sRegfgKk8m0YdA

 

Return value
{
  "message":"Granted permission OrganizationAdminPermission for account: john@example.org"
}

Action: removeAdmin

This call is available since PowerFolder Server version 11.0

This action allows an administrator or a user with OrganizationCreatePermission and the specific OrganizationAdminPermission of that Organization to remove Administrators from the Organization.

ParameterMandatoryDescriptionExample
actionYesMust always be changeMaxUsers.removeAdmin
OIDYesThis is the ID of the organization to change the maximum number of members allowed on the organization.Wni7DFkmdySELqBdsUs8
accountIDYesThe ID of the account to grant the OrganizationAdminPermissionPME2myo2355sRegfgKk8m0YdA

 

Example

http://powerfolder.example.com/api/organizations?action=removeAdmin&OID=Wni7DFkmdySELqBdsUs8&accountID=PME2myo2355sRegfgKk8m0YdA

 

Return value
{
  "message":"Revoked permission OrganizationAdminPermission for account: john@example.org"
}

Action: addDomain

This call is available since PowerFolder Server version 11.3

This action allows a user with OrganizationCreatePermission to add domains to an organization.

ParameterMandatoryDescriptionExample
actionYesMust always be addDomainaddDomain
OIDYesThe ID of the OrganizationWni7DFkmdySELqBdsUs8
domainYesA domain to add to the specified organization. Can be used multiple times per call.example.org


Example

http://powerfolder.example.com/api/organizations?action=addDomain&OID=Wni7DFkmdySELqBdsUs8&domain=example.org&domain=sub.example.org


Action: removeDomain

This call is available since PowerFolder Server version 11.3

This action allows a user with OrganizationCreatePermission to remove domains from an organization.

ParameterMandatoryDescriptionExample
actionYesMust always be addDomainremoveDomain
OIDYesThe ID of the OrganizationWni7DFkmdySELqBdsUs8
domainYesA domain to add to the specified organization. Can be used multiple times per call.example.org


Example

http://powerfolder.example.com/api/organizations?action=removeDomain&OID=Wni7DFkmdySELqBdsUs8&domain=example.org&domain=sub.example.org

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 organization. To do so any HTTP parameter added to the call to this API endpoint except action and OID will be added to the custom data.

ParameterMandatoryDescriptionExample
actionYesMust always be setJSON.setJSON
OIDYesThis is the ID of the organization.Wni7DFkmdySELqBdsUs8

Example

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


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

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 organization. To do so any HTTP parameter's key (name) added to the call to 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 organization.Wni7DFkmdySELqBdsUs8

Example

http://powerfolder.example.com/api/organizations?action=removeJSON&OID=Wni7DFkmdySELqBdsUs8&isBusiness=


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

Action: restrictToDomain

This call is available since PowerFolder Server version 11.3

This call allows you to restrict the members of an Organization to the defined set of domains.

ParameterMandatoryDescriptionExample
actionYesMust always be restrictToDomainrestrictToDomain
OIDYesThis is the ID of the organization.Wni7DFkmdySELqBdsUs8
setYesThis contains the boolean value true or falsetrue

Example

http://powerfolder.example.com/api/organizations?action=restrictToDomain&OID=Wni7DFkmdySELqBdsUs8&set=true

{
	"message":"Set restrict to domain to true"
}