Actions13
Overview
This node enables creating polls within Zalo groups. It is useful for gathering opinions, making group decisions, or conducting quick surveys among group members in a Zalo chat environment. For example, a team leader can create a poll to decide on a meeting time or vote on project priorities.
The "Tạo bình chọn" (Create Poll) operation allows you to specify the poll question, options, and various settings such as whether multiple choices are allowed, if participants can add new options, and privacy controls like hiding results until voting or anonymizing voters.
Properties
| Name | Meaning |
|---|---|
| ID Nhóm | The ID of the Zalo group where the poll will be created (only works with groups). |
| Chủ đề bình chọn | The poll question or topic to be asked. |
| Kiểu nhập lựa chọn | How to input poll options: "Danh sách" (list) to enter each option separately, or "Văn bản" (text) to enter all options in one text field separated by commas. |
| Các lựa chọn | When using "Danh sách" input type, add multiple individual options here. |
| Các lựa chọn | When using "Văn bản" input type, enter all options as a comma-separated string. |
| Thời hạn bình chọn | Optional expiration date/time for the poll; leave empty if no expiration is needed. |
| Ghim lên đầu trò chuyện | Whether to pin the poll message at the top of the chat. |
| Chọn nhiều phương án | Allow participants to select multiple options when voting. |
| Có thể thêm phương án | Allow participants to add new options to the poll. |
| Ẩn kết quả khi chưa bình chọn | Hide poll results from participants until they have voted. |
| Ẩn người bình chọn | Make votes anonymous so participants cannot see who voted for which option. |
Output
The output JSON contains:
success: Boolean indicating if the poll creation was successful.response: The raw response object returned from the Zalo API after creating the poll.groupId: The ID of the group where the poll was created.createPollData: An object containing the parameters used to create the poll, including question, options, expiration time, and other settings.
Example output structure:
{
"success": true,
"response": { /* API response data */ },
"groupId": "123456789",
"createPollData": {
"question": "Your poll question",
"options": ["Option 1", "Option 2"],
"expiredTime": 0,
"pinAct": false,
"allowMultiChoices": true,
"allowAddNewOption": true,
"hideVotePreview": false,
"isAnonymous": false
}
}
No binary data output is produced by this operation.
Dependencies
- Requires an API key credential to connect to the Zalo platform.
- The node uses a third-party Zalo API client library (
zca-js) to interact with Zalo services. - Proper configuration of credentials with valid cookie, IMEI, and user agent information is necessary for authentication.
Troubleshooting
Error: "No API instance found. Please make sure to provide valid credentials."
This indicates missing or invalid credentials. Ensure that the API key credential is correctly set up with valid authentication details.Error related to poll options processing:
If the options input is malformed or empty, the node throws an error asking to input at least one option. Verify that options are entered correctly either as a list or a comma-separated string.Network or API errors:
These may occur if the Zalo service is unreachable or the credentials have expired. Check network connectivity and refresh credentials if needed.Invalid group ID:
The poll creation only works with valid group IDs. Confirm that the provided group ID corresponds to an existing Zalo group.
Links and References
- Zalo Official Developer Documentation (for general poll API reference)
- Zalo Group Management API (for group-related operations)
Note: The above links are indicative; please refer to the official Zalo developer portal for the most current documentation.