Actions9
Overview
This node integrates with the Switch API to perform various communication-related operations within communities, channels, and groups. Specifically for the Send Message operation, it allows sending a text message to a specified channel within a community.
Common scenarios where this node is beneficial include:
- Automating notifications or alerts by sending messages to specific channels.
- Integrating external workflows with community chat systems.
- Broadcasting updates or information programmatically to team channels.
For example, you could use this node to send a welcome message automatically when a new user joins a community or to post status updates from an external monitoring system into a designated channel.
Properties
| Name | Meaning |
|---|---|
| Community ID | The unique identifier of the community where the message will be sent. |
| Channel ID | The unique identifier of the channel within the community to which the message will be sent. |
| Message | The text content of the message to send. |
Output
The node outputs a JSON object representing the response from the Switch API after attempting to send the message. This typically includes details about the sent message such as message ID, timestamp, or status confirmation depending on the API's response structure.
No binary data output is produced by this operation.
Dependencies
- Requires an API authentication token credential to authorize requests to the Switch API.
- The node makes HTTP POST requests to a local server endpoint (
http://localhost:8000/sendMessage) to send messages. - Ensure that the Switch API service is accessible at the configured URL and that the API token is valid.
Troubleshooting
Common issues:
- Invalid or missing Community ID or Channel ID can cause the API to reject the request.
- Network connectivity problems to the local API endpoint may result in request failures.
- Incorrect or expired API authentication token will lead to authorization errors.
Error messages:
"Operation "sendMessage" not supported": Indicates the operation parameter was set incorrectly; verify the operation name.- API error responses are returned in the output JSON under an
errorfield if the node is configured to continue on failure.
Resolutions:
- Double-check all required input properties are correctly set.
- Verify the API token credential is properly configured and has necessary permissions.
- Confirm the Switch API service is running and reachable at the expected URL.
Links and References
- Switch API Documentation (Replace with actual URL if available)
- n8n Documentation on Creating Custom Nodes