Zalo User Interact icon

Zalo User Interact

Gửi tin nhắn và tương tác với Zalo User

Overview

The Send Voice Message operation for the Message resource in this custom n8n node allows you to send a voice message (audio file) to a specified Zalo user or group. This is particularly useful for automating notifications, alerts, or any workflow where sending pre-recorded audio messages via Zalo is required.

Practical scenarios:

  • Sending automated voice reminders to users or groups.
  • Broadcasting announcements to group chats.
  • Integrating with other systems to deliver voice-based alerts.

Properties

Below are the input properties relevant to the "Send Voice Message" operation:

Display Name Type Description
User/Group Id String ID của Zalo User/Group để gửi tin nhắn đến. (ID of the Zalo user or group to send the message to.)
Thread Type Options Loại cuộc trò chuyện. User hoặc Group. (Type of conversation: User or Group.)
Options:
  • User (0)
  • Group (1)
Voice URL String URL của file âm thanh (URL of the audio file to be sent as a voice message.)

All three fields are required for this operation.

Output

The output of this node for each processed item will be an object with the following structure:

{
  "success": true,
  "data": { ... }
}
  • success: Boolean indicating if the operation was successful.
  • data: Contains the response data from the Zalo API after attempting to send the voice message. The exact structure depends on the API's response but typically includes information such as message IDs, status, and possibly error details if the operation failed.

If there is an error, the output may look like:

{
  "success": false,
  "error": "Error message",
  "stack": "Stack trace (if available)"
}

Dependencies

  • Zalo API Access: You must have valid credentials and permissions to send messages via the Zalo API.
  • Network Access: The node needs to access the provided Voice URL to fetch the audio file.
  • n8n Configuration: Ensure that any necessary authentication (API keys, tokens) for Zalo is configured in your n8n instance.

Troubleshooting

Common issues:

  • Invalid User/Group ID: If the provided ID does not exist or is incorrect, the message will not be delivered.
  • Incorrect Thread Type: Make sure to select the correct type (User or Group) matching the ID.
  • Voice URL Issues: If the URL is inaccessible, invalid, or the file format is unsupported, the operation will fail.
  • API Authentication Errors: Missing or invalid Zalo API credentials will result in authentication errors.

Common error messages:

  • "Invalid User/Group ID": Check the ID and ensure it exists in Zalo.
  • "Failed to fetch audio file": Verify the Voice URL is correct and accessible.
  • "Authentication failed": Ensure your Zalo API credentials are correctly set up in n8n.
  • "API limit exceeded": You may have hit Zalo's rate limits; try again later.

Links and References


Note: For best results, always test your configuration with a known working User/Group ID and a publicly accessible audio file URL.

Discussion