Zalo Send Message icon

Zalo Send Message

Gửi tin nhắn qua API Zalo sử dụng kết nối đăng nhập bằng cookie

Overview

This node allows sending video messages through the Zalo messaging platform by interacting with the Zalo API using a logged-in session authenticated via cookies. It supports sending videos to either individual users or group chats, including specifying video metadata such as duration and dimensions, along with an optional caption.

Typical use cases include:

  • Automating video message delivery in customer support or marketing workflows.
  • Broadcasting video content to specific user groups or individuals on Zalo.
  • Integrating video communication into business processes that use Zalo as a communication channel.

For example, a business could automatically send product demo videos to customers who request them via chat, or a community manager could share event highlight videos to a group chat.

Properties

Name Meaning
ID cuộc trò chuyện / Thread ID The unique identifier of the conversation (user or group) where the video will be sent.
Loại cuộc trò chuyện Type of conversation: "Cá nhân" (Individual user) or "Nhóm" (Group chat).
Video URL Publicly accessible URL of the video file to send.
Thumbnail URL Publicly accessible URL of the video's thumbnail image.
Phụ đề / Caption Optional caption text to accompany the video message.
Tùy chọn Video nâng cao Advanced video options including:
- Thời lượng (giây) Duration of the video in seconds.
- Chiều rộng (pixels) Width of the video in pixels (default 1280).
- Chiều cao (pixels) Height of the video in pixels (default 720).

Output

The node outputs JSON data for each input item processed, structured as follows:

  • success: Boolean indicating if the video was sent successfully.
  • response: The raw response object returned from the Zalo API after sending the video.
  • threadId: The ID of the conversation where the video was sent.
  • threadType: Numeric code representing the conversation type (0 for individual, 1 for group).

No binary data output is produced by this operation.

Dependencies

  • Requires valid Zalo API credentials configured in n8n, specifically an API key credential that includes a cookie string, IMEI, and user agent for authentication.
  • The node uses the zca-js library internally to interact with the Zalo API.
  • The video and thumbnail URLs must be publicly accessible over the internet for Zalo to fetch and send them.

Troubleshooting

  • Zalo API Initialization Failure: If the node throws an error about failing to initialize the Zalo API, verify that the provided credentials are correct and contain a valid cookie, IMEI, and user agent.
  • Missing Required Fields: Errors will occur if the Video URL or Thumbnail URL are empty or invalid. Ensure these URLs are accessible and correctly entered.
  • Network or Access Issues: Since the video and thumbnail URLs must be publicly accessible, private or restricted URLs will cause failures.
  • API Rate Limits or Quotas: Sending many messages rapidly may trigger rate limits; handle errors accordingly.
  • Error Messages: The node surfaces errors from the Zalo API directly. Review the error message for clues, such as invalid parameters or authentication issues.

Links and References

Discussion