Actions9
Overview
This node integrates with the Switch API to manage and interact with communication communities, channels, groups, and messages. It supports operations such as retrieving community information, listing groups or channels within a community, sending messages or media, creating groups or channels, forwarding messages, and pinning messages.
A common use case is automating community management tasks or message distribution in a communication platform that uses the Switch API. For example, you can automatically fetch details about a community before sending targeted messages, or create new channels/groups dynamically based on workflow conditions.
Specifically, the Get Community Info operation retrieves detailed information about a specified community by its ID, which can be useful for monitoring or reporting purposes.
Properties
| Name | Meaning |
|---|---|
| Community ID | ID of the community to target. Required for operations: Get Community Info, List Groups, List Channels, Send Message, Send Media. |
(Note: Only the "Community ID" property is relevant here as per your request for the "Get Community Info" operation.)
Output
The output is a JSON object containing the response from the Switch API for the requested operation. For the Get Community Info operation, this JSON includes detailed information about the specified community, such as its metadata, members, settings, or other attributes provided by the API.
No binary data output is produced by this operation.
Example output structure (simplified):
{
"id": "community-id",
"name": "Community Name",
"description": "Description of the community",
"membersCount": 123,
"createdAt": "2023-01-01T00:00:00Z",
...
}
Dependencies
- Requires an API key credential for authenticating requests to the Switch API.
- The node makes HTTP POST requests to a local server endpoint (
http://localhost:8000/get_community_info) with the community ID in the request body. - The API token is sent in the
Authorizationheader as a Bearer token. - Ensure the Switch API service is accessible at the configured URL and the API key is valid.
Troubleshooting
Common issues:
- Invalid or missing community ID will likely cause the API to return an error.
- Authentication failures if the API token is incorrect or expired.
- Network errors if the local server (
localhost:8000) is not running or unreachable.
Error messages:
"Operation \"getCommunityInfo\" not supported": This indicates an unsupported operation was selected; ensure the operation name matches exactly.- API errors returned in the JSON response under an error field may indicate issues like invalid parameters or permission problems.
Resolutions:
- Verify the community ID is correct and exists.
- Check that the API key credential is properly configured and has necessary permissions.
- Confirm the Switch API service is running and accessible at the expected URL.
- Use the node's "Continue On Fail" option to handle errors gracefully in workflows.
Links and References
- Switch API Documentation (Replace with actual URL)
- n8n documentation on Creating Custom Nodes
- General info on HTTP Request Node (for understanding underlying request mechanics)