Organization Endpoint

Organizational Units are defined as a two tier structure, typically, but not necessarily, reflecting a company-department structure. The following calls require the user to pass the Org Unit Name they are editing, along with the parent Org Unit. An empty string can be provided when a top level (Company) Org Unit is being created and/or edited.

1. Create Org Unit

createOrgUnit (String name, String parent, HashMap fieldValues)

Parameters

  • name New name for this Org Unit
  • parent Name of the parent if there is one.
  • fieldValues Map of field values.

Description

Pass the Org Unit Name, the parent Org Unit Name and a map of field values to this method to create an Organizational Unit. If the Org Unit being created is a company, pass an empty string as the parent field. If creating a department (or child org unit) the parent must already exist or an error message will be returned.

The complete list of fields that can be supplied reflect the fields returned from the get method below – but names and contact information are the general values, along with any custom fields that may be defined.

This method will return a Map containing the success field and a message field if the method call failed.

2. Get Org Unit Details

getOrgUnitDetails (String name, String parent) (since 6.0)
getOrgUnitDetails (String orgUnitId) (since 6.1.4)

Parameters

  • name Name of the Org Unit to retrive details from.
  • parent Parent name of the Org Unit if there is one.
  • orgUnitId Org Unit Id to retrieve details from.

Description

Pass either the Org Unit Id or the Org Unit Name and Parent Org Unit Name into this method to get the details for an organizational unit. This will return a HashMap of name value pairs representing the fields of the company or department.

The valid keys for organization web services are: ?address, addressTwo, city, state, country, zip, phone, url, primaryContact.

The returned map will also contain a success field. If there was a problem with the execution there will be a message field to explain what the issue was.

3. Update Org Unit Details

updateOrgUnit (String name, String parent, HashMap fieldValues)

Parameters

  • name Name of this Org Unit
  • parent Name of the parent if there is one.
  • fieldValues Map of field values.

Description

Along the same theme as the previous update methods, this update takes two strings to identify the organizational unit and a parameter map containing the fields to update and the new values for those fields.

This method will return a Map containing the success field and a message field if the method call failed.

4. Rename Org Unit

renameOrgUnit (String name, String parent, String newName) (since 6.0)

Parameters

  • name Name of this Org Unit
  • parent Name of the parent if there is one.
  • newName The new name of this org unit.

Description

Along the same theme as the update methods, two strings are used to identify the organizational unit where a parent value of an empty string defines a company, or content in both fields defining a department. The ‘newName’ field defines the new name for the Org. Unit specified by the first two parameters.

This method will return a Map containing the success field and a message field if the method call failed.

5. Find Org Unit

findOrgUnit (String name, String parent, HashMap fieldValues) (since 6.0)

Parameters

  • name Name of this Org Unit
  • parent Name of the parent if there is one.
  • fieldValues Map of field values.

Description

Use this function to search for an org unit. Valid keys for the map include ‘name’ and ‘parent’ along with all the parameters defined in the org unit details method: ?address, addressTwo, city, state, country, zip, phone, url, primaryContact

This method will return a Map containing the ID’s and the display strings of the org units that match the criteria along with the success field and a message field if the method call failed.

6. Delete Org Unit

deleteOrgUnit (String orgUnitId) (since 6.0.1)

Parameters

  • orgUnitId Org Unit Id to delete.

Description

This function flags an Org Unit as deleted.