Overview
This node allows interaction with Rocket.Chat messaging functionalities, specifically focusing on sending direct messages (DMs) in the 'Send DM' operation. It opens a direct message channel with a specified user and sends a message to that DM. This is useful for automating personal communications within Rocket.Chat, such as sending notifications, alerts, or personalized messages to individual users.
Use Case Examples
- Automatically send a welcome message to a new user via DM.
- Send a direct alert to a specific user when a certain event occurs in your workflow.
Properties
| Name | Meaning |
|---|---|
| Text | The content of the message to send in the DM. |
| Thread ID (tmid) | Optional thread ID to send the message as a reply within a thread. |
| Additional Fields | Optional extra message parameters such as alias, emoji avatar, avatar URL, whether to parse URLs, and attachments in JSON format. |
| Username | The username of the user to open a DM with and send the message to. |
Output
JSON
jsonroom
*_id- The ID of the direct message room opened with the user.message- The message object returned after sending the DM message.
Dependencies
- Requires an API key credential for Rocket.Chat (rocketChatPat) to authenticate API requests.
Troubleshooting
- If the DM cannot be opened, an error 'Could not open DM with @username' is thrown. Ensure the username is correct and the authenticated user has permission to open DMs.
- Attachments must be valid JSON arrays; invalid JSON will cause errors.
- If the message fails to send, check network connectivity and API permissions.
Links
- Rocket.Chat API - Open Direct Message - API method used to open a direct message channel with a user.
- Rocket.Chat API - Post Message - API method used to send a message to a chat room or DM.