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 enables sending a contact card ("danh thiếp") message via the Zalo messaging platform using its API. It is designed for scenarios where you want to share a user's contact information within a Zalo chat, either in a personal conversation or a group chat.

Practical examples include:

  • Automatically sharing a team member's contact card in a customer support group.
  • Sending a business partner's contact card directly to a client in a private chat.
  • Integrating with CRM systems to push contact cards into relevant Zalo conversations.

The node requires authentication via Zalo API credentials (cookie-based login) and supports specifying the target conversation and the user whose contact card will be sent.

Properties

Name Meaning
ID cuộc trò chuyện / Thread ID The unique identifier of the conversation (chat thread) where the contact card will be sent.
Loại cuộc trò chuyện The type of conversation: "Cá nhân" (Personal chat) or "Nhóm" (Group chat). Options: 0 (Cá nhân), 1 (Nhóm).
ID Người dùng (Danh thiếp) The user ID of the contact whose card you want to send.
Số điện thoại (Tùy chọn) Optional phone number of the user in the contact card.

Output

The output JSON object contains:

  • success: Boolean indicating if the operation was successful.
  • response: The raw response from the Zalo API after sending the contact card.
  • threadId: The ID of the conversation where the card was sent.
  • threadType: The type of the conversation (user or group).

No binary data is output by this operation.

Example output JSON structure:

{
  "success": true,
  "response": { /* Zalo API response object */ },
  "threadId": "123456789",
  "threadType": 0
}

Dependencies

  • Requires valid Zalo API credentials that include a cookie, IMEI, and user agent string for authentication.
  • Uses the Zalo API client library internally to perform actions such as sending messages and typing events.
  • No additional external services are required beyond the Zalo API.
  • Proper configuration of the Zalo API credential in n8n is necessary before use.

Troubleshooting

  • Failed to initialize Zalo API: This error indicates invalid or missing credentials. Verify that the cookie, IMEI, and user agent are correctly set in the Zalo API credential.
  • User ID (for card) is required: Make sure the "ID Người dùng (Danh thiếp)" property is provided and not empty.
  • Zalo API not initialized: Occurs if the node attempts to send a message without successful login. Check credentials and network connectivity.
  • Error sending Zalo message: General catch-all for API errors; inspect the error message for details. Enabling "Continue On Fail" can help process multiple items even if some fail.
  • If the phone number is provided, ensure it is in the correct format expected by Zalo.

Links and References

Discussion