Get User Departments
Get User Departments
Retrieves the Departments of a specified user.
This API can be used to create UI that displays user information, based on the target user's information.
When Display name in different language is set, the value will be returned in the language set by the user executing this API.
Function
kintone.user.getOrganizations(code)
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| code | String | The login name. If ignored, the logged-in user's information will be retrieved. |
Returns
A Promise object.
When the Promise object is fulfilled, an array of objects containing the following elements can be retrieved:
| Property | Type | Value and Description |
|---|---|---|
| organization | object | Department information |
| organization.id | string | Department ID |
| organization.code | string | Department code |
| organization.name | string | Department name |
| organization.primary | boolean | The status of the Primary department
|
| title | object | Job title information. Returns null if not set. |
| title.id | string | Job title ID |
| title.code | string | Job title code |
| title.name | string | Job title name |
Available Pages
However, it cannot be used on the following pages:
- Search results
- Marketplace
- Plug-in settings page
Notes
- This API retrieves data from the server at runtime. The retrieved data is cached until a screen transition occurs. If there are more than 50 data retrievals from the server per minute per user, the returned Promise object will be rejected.
- To retrieve other information about the department, use the following API:
Get Departments