Overview
This node obtains a tenant access token from the Larksuite platform by using the provided App ID and App Secret of a Lark application. It is useful when you need to authenticate API requests to Larksuite services on behalf of a tenant, enabling further interactions with Larksuite APIs that require this token.
Common scenarios include:
- Automating workflows that integrate with Larksuite collaboration tools.
- Fetching or managing tenant-specific data in Larksuite.
- Using the token as a credential for subsequent API calls within an n8n workflow.
Example: You provide your Lark application's App ID and App Secret, and the node returns a valid tenant access token that can be used to authorize other API requests.
Properties
| Name | Meaning |
|---|---|
| App ID | The unique identifier of your Lark application (e.g., cli_xxxxxxxxxxxxxxxxxxxxx). |
| App Secret | The secret key associated with your Lark application, used for authentication. |
Output
The node outputs JSON data containing the response from the Larksuite API endpoint for tenant access tokens. This typically includes:
tenant_access_token: The token string used for authenticating further API requests.expire: The expiration time (in seconds) of the token.
The output structure mirrors the Larksuite API response for tenant access tokens. No binary data is produced.
Dependencies
- Requires internet access to call the Larksuite API endpoint at
https://open.larksuite.com/open-apis/auth/v3/tenant_access_token/internal. - Needs an API key credential consisting of the App ID and App Secret of a Lark application.
- Uses the Axios HTTP client library internally to make the POST request.
Troubleshooting
- Invalid credentials error: If the App ID or App Secret are incorrect, the API will reject the request. Double-check these values.
- Network errors: Ensure the node has network access to the Larksuite API endpoint.
- Unexpected API responses: If the API changes or is temporarily unavailable, the node may throw errors. Check Larksuite service status.
- The node logs errors to the console before throwing them; reviewing these logs can help diagnose issues.