Zalo Gửi tin nhắn by diginno.net
AI-generatedOverview
This node sends messages via the Zalo API, supporting both text and video message types. It allows sending messages to individual users or groups, with options for text formatting using Markdown, message urgency levels, and automatic message deletion after a specified time (TTL). For video messages, it supports sending videos from either a public URL or binary data, with automatic metadata extraction and thumbnail handling. The node also supports quoting specific messages and attaching multiple files to text messages. It is useful for automating communication on the Zalo platform, such as sending notifications, marketing messages, or multimedia content.
Use Case Examples
- Send a plain text message to a user with Markdown formatting enabled.
- Send a video message to a group using a video URL with automatic metadata extraction.
- Send a text message quoting a previous message and attaching multiple image files.
- Send a video message from binary data with a custom thumbnail URL and specified video dimensions.
Properties
| Name | Meaning |
|---|---|
| ID Cuộc Trò Chuyện | The ID of the conversation (thread) to which the message will be sent. |
| Loại | The type of message recipient: individual user or group. |
| Loại Nội Dung | The type of content to send: text/image or video. |
| Tin Nhắn | The text content of the message to send. Supports tagging users in groups and Markdown formatting if enabled. |
| Nguồn Video | Source of the video content: public URL or binary data from a previous node. |
| URL Video | The public URL of the video to send. Required if video source is URL. |
| Binary Property | The property name containing the binary video data. Required if video source is binary. |
| URL Thumbnail | Optional URL of the thumbnail image for the video. If empty, the thumbnail is auto-generated if ffmpeg is installed. |
| Tự Động Lấy Metadata Video | Whether to automatically extract video metadata such as duration and dimensions from the URL. |
| Tin Nhắn Kèm Video | Optional text message to accompany the video. |
| Thời Lượng Video (ms) | Duration of the video in milliseconds. Set to 0 if unknown. |
| Chiều Rộng Video | Width of the video in pixels. Default is 1280. |
| Chiều Cao Video | Height of the video in pixels. Default is 720. |
| Bật Markdown | Enable Markdown syntax for text message formatting. |
| Mức Độ Khẩn | Urgency level of the message. |
| Thời Gian Tự Xóa (TTL) | Time in milliseconds after which the message will be automatically deleted. 0 means no auto-delete. |
| Trả Lời Tin Nhắn | Details for quoting or replying to a specific message, including message ID, sender ID, content, client message ID, timestamp, message type, and TTL. |
| File ĐÍnh Kèm | One or more attached files to send with the text message. Supports URLs, arrays of URLs, local file paths, and arrays of local file paths. |
Output
JSON
success- Indicates whether the message was sent successfully.threadId- The ID of the conversation to which the message was sent.threadType- The type of the conversation (user or group).messageType- The type of message sent (text or video).source- The source of the video if messageType is video (url or binary).fileName- The file name of the uploaded video if applicable.fileSize- The size in bytes of the uploaded video if applicable.uploadedUrl- The URL of the uploaded video if applicable.videoOptions- Object containing video metadata such as videoUrl, thumbnailUrl, message, duration, width, height, and TTL.response- The raw response from the Zalo API after sending the message.messageContent- The constructed message content object sent to the API (for text messages).autoDetectedMetadata- Automatically detected video metadata if applicable.error- Error message if sending the message failed.
Dependencies
- Zalo API credentials (cookie, imei, userAgent)
- ffmpeg and ffprobe installed on the server for video metadata extraction and thumbnail generation
- Node.js modules: axios, form-data, fs, os, and custom utilities for message building, attachment processing, and video processing
Troubleshooting
- Error: 'Zalo API not initialized' - Check that the Zalo API credentials (cookie, imei, userAgent) are correctly configured.
- Error: 'Video URL is required' - Ensure the video URL is provided when sending a video from a URL source.
- Error: 'Could not generate thumbnail' - Provide a valid thumbnail URL or install ffmpeg on the server.
- Error: 'Video URL is not publicly accessible' - Make sure the video URL is accessible by Zalo servers.
- Error: 'Upload to catbox failed' - Check network connectivity and availability of the catbox.moe service used for video uploads.
- Error: 'Some attachments failed' - Verify that all attachment URLs or local file paths are correct and accessible.
- Warnings about message sending failures - Check the error messages and ensure the API limits and message formats are respected.
Links
- Tài liệu hướng dẫn - Official documentation and guide for using the Zalo node in n8n.
- diginno.net - Expert service provider for n8n implementation in Vietnam.