Actions8
- Zalo Send Message Actions
- Zalo Text To Speech Actions
Overview
This node enables sending text-to-speech (TTS) messages via the Zalo platform. It converts input text into speech audio using Zalo's TTS API and then sends the generated voice message to a specified user or group thread on Zalo. This is useful for automating voice notifications, alerts, or personalized audio messages in chat conversations.
Practical examples include:
- Sending automated voice reminders or announcements to users or groups.
- Converting chatbot responses into voice messages for enhanced engagement.
- Broadcasting voice alerts in group chats.
Properties
| Name | Meaning |
|---|---|
| Thread ID | The ID of the user or group thread to which the TTS message will be sent. |
| Type | The type of the thread: either "User" (individual chat) or "Group" (group chat). |
| Text | The text content that will be converted into speech audio. |
| Voice (Giọng đọc) | The voice profile used for speech synthesis. Options include various male/female voices from different Vietnamese regions: - Phụ nữ miền Nam 1 - Phụ nữ miền Bắc 1 - Đàn ông miền Nam - Đàn ông miền Bắc - Phụ nữ miền Bắc 2 - Phụ nữ miền Nam 2 |
| EnCode Output | The audio encoding format for the output speech file. Options are WAV, MP3, or AAC. |
| Speed | Playback speed of the synthesized speech, ranging from 0.8 (slower) to 1.2 (faster). |
Output
The node outputs JSON data containing the result of the TTS conversion and message sending process. For the "Send TTS Message" operation, the output JSON includes:
success: Boolean indicating if the message was sent successfully.message: Confirmation string ("TTS voice message sent successfully.").response: The raw response object from the Zalo API after sending the voice message.threadId: The ID of the thread where the message was sent.threadType: Numeric code representing the thread type (user or group).ttsUrl: The URL of the generated speech audio file returned by the Zalo TTS API.
No binary data is directly output by this node; instead, it provides a URL to the synthesized audio.
Dependencies
- Requires valid credentials for two APIs:
- A Zalo API credential with cookie, IMEI, and user agent information to authenticate and send messages.
- A Zalo TTS API credential containing an API key for accessing the text-to-speech service.
- The node makes HTTP POST requests to the Zalo TTS API endpoint (
https://api.zalo.ai/v1/tts/synthesize) to generate speech audio. - Uses an internal Zalo API client library to send voice messages and typing events.
Troubleshooting
- Failed to initialize Zalo API: Indicates invalid or missing Zalo API credentials. Verify that the cookie, IMEI, and user agent values are correct.
- Zalo login error: Occurs if authentication with Zalo fails. Check credentials and network connectivity.
- Zalo TTS API credentials are not set or invalid: The TTS API key is missing or incorrect. Ensure the API key credential is configured properly.
- Zalo TTS API error: Returned when the TTS service responds with an error. Review the error message for details, such as invalid parameters or quota limits.
- Failed to get audio URL from Zalo TTS API response: The TTS API did not return a valid audio URL. Confirm the request parameters and try again.
- Zalo API client not initialized: Happens if the Zalo API client failed to initialize before sending the voice message. Check earlier errors related to authentication.
To resolve these issues, verify all credentials, ensure proper parameter values, and confirm network access to Zalo services.