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

The Zalo Send Message node enables sending various types of messages through the Zalo messaging platform using its API authenticated by a login cookie. Specifically, for the "Gửi sticker" (Send sticker) operation, it allows users to send stickers to either individual users or group conversations on Zalo.

This node is useful in scenarios such as:

  • Automating customer engagement by sending stickers as part of chat interactions.
  • Enhancing chatbot responses with expressive stickers.
  • Integrating Zalo messaging into workflows that require multimedia message sending.

For example, a business could automatically send a thank-you sticker after a customer completes a purchase, or a chatbot could respond with relevant stickers based on user input.

Properties

Name Meaning
ID cuộc trò chuyện / Thread ID The unique identifier of the conversation (user or group) where the sticker will be sent.
Loại cuộc trò chuyện The type of conversation:
- Cá nhân (Individual user)
- Nhóm (Group chat)
Sticker ID The unique identifier of the sticker to send.

Output

The node outputs a JSON object containing:

  • success: Boolean indicating if the sticker was sent successfully.
  • response: The raw response from the Zalo API after sending the sticker.
  • threadId: The ID of the conversation where the sticker was sent.
  • stickerId: The ID of the sticker sent.
  • stickerObj: The detailed sticker object retrieved from the Zalo API before sending.

No binary data output is produced by this operation.

Dependencies

  • Requires valid Zalo API credentials authenticated via a login cookie, IMEI, and user agent string.
  • The node depends on the external Zalo API client library (zca-js) to interact with Zalo services.
  • Proper configuration of the Zalo API credential in n8n is necessary to provide authentication details.
  • Network access to Zalo's API endpoints is required.

Troubleshooting

  • Common issues:

    • Invalid or expired login cookie causing authentication failure.
    • Incorrect or missing sticker ID leading to errors when fetching sticker details.
    • Sending to an invalid thread ID or wrong thread type (user vs group).
    • Network connectivity problems preventing API calls.
  • Error messages and resolutions:

    • "Failed to initialize Zalo API. Check your credentials."
      Ensure that the Zalo API credentials are correctly set up with a valid cookie, IMEI, and user agent.
    • "Sticker detail is invalid or missing required fields"
      Verify that the provided sticker ID exists and is correct.
    • Errors related to sending typing events or messages usually indicate temporary API issues; retrying may help.
    • If the node throws errors about missing parameters like thread ID or sticker ID, confirm these inputs are provided and valid.

Links and References


This summary focuses exclusively on the "Gửi sticker" operation within the "Zalo Send Message" resource as requested.

Discussion