Switch icon

Switch

Switch API Integration

Overview

This node integrates with the Switch API to perform various communication-related operations such as sending messages, creating channels or groups, forwarding and pinning messages, and retrieving community information. The "Forward Message" operation specifically allows users to forward an existing message to a different channel or group within the platform.

Common scenarios for using the "Forward Message" operation include:

  • Automatically sharing important announcements from one channel to multiple other channels.
  • Redirecting user queries or feedback messages to relevant groups for faster response.
  • Archiving or highlighting messages by forwarding them to dedicated channels.

For example, a community manager could use this node to forward a key update message from a general channel to a private team group automatically.

Properties

Name Meaning
Message ID ID of the message to forward.
Target Channel/Group ID ID of the target channel or group where the message will be forwarded.

Output

The node outputs a JSON object representing the response from the Switch API after attempting to forward the message. This typically includes details about the forwarded message or confirmation of success. The exact structure depends on the API's response but generally contains metadata about the forwarded message.

No binary data output is produced by this operation.

Dependencies

  • Requires an API authentication token credential to access the Switch API.
  • The node makes HTTP POST requests to a local server endpoint (http://localhost:8000/forward_message) which acts as a proxy or middleware to the actual Switch API.
  • Proper configuration of the API token in n8n credentials is necessary for authorization.

Troubleshooting

  • Common Issues:

    • Invalid or missing Message ID or Target Channel/Group ID will cause the API request to fail.
    • Incorrect or expired API token will result in authorization errors.
    • The local server at http://localhost:8000 must be running and accessible; otherwise, requests will fail.
  • Error Messages:

    • "Operation "forwardMessage" not supported": Indicates the operation parameter was set incorrectly.
    • API errors returned from the server (e.g., 401 Unauthorized, 404 Not Found) usually indicate issues with credentials or invalid IDs.
  • Resolutions:

    • Verify that the Message ID and Target ID are correct and exist in the system.
    • Ensure the API token credential is valid and has sufficient permissions.
    • Confirm that the local server endpoint is reachable and properly configured.

Links and References

Discussion