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 operation allows sending voice messages via the Zalo messaging platform by converting text content into speech. It is useful in scenarios where users want to automate sending audio messages instead of plain text, such as for notifications, alerts, or personalized voice communications. For example, a business could use this node to send automated voice reminders to customers or deliver announcements in different languages.

Properties

Name Meaning
Thread ID The unique identifier of the conversation thread where the voice message will be sent.
Type The type of the message recipient: 0 for individual user, 1 for group chat.
Message The text content that will be converted into voice and sent as a voice message.
Language The language/voice for text-to-speech conversion. Options include: Tiếng Việt (Vietnamese), English (US), Tiếng Trung (Chinese), Tiếng Hàn (Korean), Tiếng Nhật (Japanese).

Output

The node outputs a JSON object containing:

  • success: Boolean indicating if the message was sent successfully.
  • response: The raw response from the Zalo API after sending the voice message.
  • threadId: The ID of the thread where the message was sent.
  • threadType: The type of thread (user or group).
  • messageContent: The original message content that was converted to voice.
  • voiceUrl: URL to the generated voice message.
  • voiceFile: Local path to the downloaded voice file.
  • language: The language used for text-to-speech.
  • fileSize: Size of the voice file in KB (if available).

If the node fails to send the message, the output JSON includes:

  • success: false
  • error: Error message describing the failure.

Dependencies

  • Requires an active Zalo API connection authenticated with appropriate credentials (e.g., cookie, device IMEI, user agent).
  • Uses internal helper utilities for downloading and saving voice files.
  • Node expects proper configuration of Zalo API credentials within n8n.

Troubleshooting

  • Common issues:

    • Invalid or expired Zalo API credentials can cause authentication failures.
    • Incorrect Thread ID or Type may result in message delivery errors.
    • Network issues might prevent downloading or uploading voice files.
    • Text-to-speech conversion failure if the input message is empty or contains unsupported characters.
  • Error messages:

    • "Zalo API not initialized": Indicates missing or invalid credentials; verify credential setup.
    • "Failed to download video" or similar file handling errors: Check file URLs and network connectivity.
    • "Chuyển đổi text-to-speech thất bại" (Text-to-speech conversion failed): Ensure the message text is valid and supported.
    • General API errors returned from Zalo are passed through; check the error details for troubleshooting.
  • Resolution tips:

    • Confirm all required properties are correctly set.
    • Refresh or reconfigure Zalo API credentials.
    • Validate network access and permissions for file operations.
    • Test with simple text messages to isolate TTS issues.

Links and References

Discussion