Organizational Units are defined as a two tier structure, reflecting a company-department structure. The following API’s 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.
createOrgUnit (String name, String parent, HashMap fieldValues)
This API is used to create an Organizational Unit. The Org Unit Name, the parent Org Unit Name and a map of field values are the inputs.
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.
The following are the input parameters for this API:
name: The name of the Org unit to be created.
parent: The name of the parent if present.
fieldValues: The map of field values.
This API returns a Map containing the success field and a message field if the method call failed.
getOrgUnitDetails (String name, String parent)
getOrgUnitDetails (String orgUnitId)
This API is used to get details of an Organizational Unit. The Org Unit id or Org Unit Name and a map of field values are the inputs.
The following are the input parameters for this API:
name: The name of the Org unit.
parent: The name of the parent of the Org Unit if there are any.
orgUnitId: The Org Unit Id to retrieve details from.
This API returns 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.
updateOrgUnit (String name, String parent, HashMap fieldValues)
This API updates the organizational unit and a parameter map containing the fields to update and the new values for those fields.
The following are the input parameters for this API:
name: The name of the Org unit
parent: The name of the parent of the Org Unit if there are any
fieldValues: The map of the field values.
This API returns a HashMap containing the success field and a message field if the method call failed.
renameOrgUnit (String name, String parent, String newName)
This API renames the organizational unit with the new name. The two strings name and parent 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 following are the input parameters for this API:
name: The name of the Org unit
parent: The name of the parent of the Org Unit if there are any
newname: The new name of the Org unit.
This API returns a HashMap containing the success field and a message field if the method call failed.
findOrgUnit (String name, String parent, HashMap fieldValues)
This API is used 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.
The following are the input parameters for this API:
name: The name of the Org unit
parent: The name of the parent of the Org Unit if there are any
fieldValues: The map of the field values.
This API returns a HashMap 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.
deleteOrgUnit (String orgUnitId)
This API flags an Org Unit as deleted.
The following are the input parameters for this API:
orgUnitId: The Org unit id to be deleted.
None