The Perform & Engage 365 API enables you to:
Get a list of departments
GET /api/v2/departments/
This request enables you to get a list of departments in your organization.
Optional query parameters
- name (string). The case-insensitive department name or part of its name.
- limit (integer). The maximum number of departments in the response.
- offset (integer). The initial index from which the results are returned in the response.
Request example
GET /api/v2/departments/?name=IT
Response body parameters
The response body includes:
- count (integer). The number of results.
- next and previous (strings). URLs to the next and previous pages (if you used pagination in the original request).
-
results (array). The list of departments. Each department has these parameters:
- name (string). The department name.
- api_id (string). The department ID. You can use this ID to get more details about the department.
-
admin (array). The list of department admins. Each department admin has these parameters:
- name (string). The department admin's full name.
- email (string). The department admin's email address.
- api_id (string). The department admin's user ID.
Response body example
The successful 200 response returns the body similar to this:
{
"count": 2,
"next": null,
"previous": null,
"results": [
{
"name": "IT Team",
"api_id": "6045BDD1-ECA5-1EEF-8D8E-B29013F9F3EA",
"admins": []
},
{
"name": "IT Team 2",
"api_id": "6045BDD1-ECA5-1EEF-8D8F-AF2D319F93EC",
"admins": [
{
"name": "Michael Test",
"email": "mtest@test.com",
"api_id": "f88ab8b9-4e41-4025-ad77-519006ba855f"
}
]
}
]
}
Get the details of a particular department by its ID
GET api/v2/departments/{api_id}/
After getting the department api_id in the response to the previous request, you can use this ID to get information about the department.
Required path parameter
- api_id (string). The department ID you can get by sending the GET /api/v2/departments/ request.
Request example
GET /api/v2/departments/acac5180-6186-4058-a9b6-c8d19723fdfa/
Response body parameters
In addition to the same parameters as the results array in the GET /api/v2/departments/ response includes, the GET api/v2/departments/{api_id}/ response includes the members array that is a list of department members. The members array contains:
- name (string). The department member's full name.
- email (string). The department member's email address.
- api_id (string). The department member's user ID.
- person_properties (array). The array contains the department member's properties as the name and value pair of string parameters. For example, it could be the department member's role at the company.
-
manager (object). The list of department member's managers includes:
- name (string). The manager's full name.
- email (string). The manager's email address.
- person_properties (array). The manager's properties as the name and value pairs of string parameters.
- department (string). The department to which the manager belongs.
Response body example
The successful 200 response returns the body similar to this:
{
"name": "Database administration",
"api_id": "acac5180-6186-4058-a9b6-c8d19723fdfa",
"admins": [],
"members": [
{
"name": "Hans Test",
"email": "htest@test.com",
"api_id": "b8f2809d-5aa6-4f4a-a0c2-fa7d9074fb6f",
"person_properties": [],
"manager": null
},
{
"name": "Patrick Test",
"email": "ptest@test.com",
"api_id": "01973036-b10e-4310-b1df-230277817c08",
"person_properties": [],
"manager": {
"name": "Test Manager",
"email": "tmanager@test.com",
"person_properties": [],
"department": "Human Success"
}
}
]
}
Comments
Article is closed for comments.