Actions38
- User Actions
- Department Actions
- User Group Actions
- User Group Member Actions
- Unit Actions
- Workforce Type Actions
- Custom User Field Actions
- Contact Scope Actions
Overview
This node interacts with the Lark Contacts API to obtain a list of subdepartments under a specified department. It is useful for organizational management scenarios where you need to retrieve hierarchical department structures, such as displaying nested departments in an internal company directory or syncing department data with other systems.
For example, if you want to get all subdepartments under the root department (ID 0) or any specific department, this node will fetch that list, enabling further processing or display.
Properties
Name | Meaning |
---|---|
Authentication | Method of authentication to use: either "Tenant Token" or "OAuth2". |
Department Id | The ID of the department whose subdepartments you want to retrieve. The root department ID is 0. |
Options > Use Custom Body | Whether to send a custom request body instead of the default one (boolean). |
Output
The node outputs JSON data containing the list of subdepartments retrieved from the Lark Contacts API. Each item in the output typically represents a subdepartment with its details such as ID, name, and possibly other metadata provided by the API.
If binary data were involved (not indicated here), it would be summarized accordingly, but this node focuses on JSON structured data representing department information.
Dependencies
- Requires access to the Lark Suite Open APIs.
- Needs either a Tenant Token or OAuth2 credentials configured in n8n for authentication.
- The base URL for API requests is
https://open.larksuite.com/open-apis
. - Proper permissions/scopes must be granted to the API credentials to read department information.
Troubleshooting
- Invalid Department ID: If the department ID does not exist or is invalid, the API may return an error or empty list. Verify the department ID before running.
- Authentication Errors: Ensure that the selected authentication method is correctly configured and the token or OAuth2 credentials are valid and have sufficient permissions.
- API Rate Limits: Hitting rate limits on the Lark API can cause errors; consider implementing retries or backoff strategies.
- Use Custom Body Option: If enabled incorrectly, the custom body might cause malformed requests leading to API errors. Use this option only if you know the exact request format required.