Actions3
Overview
This node integrates with the Zalo platform to manage polls within Zalo groups. It allows users to create new polls, retrieve detailed information about existing polls, and lock polls to prevent further voting. This is particularly useful for community managers or marketers who want to engage group members through interactive polls on Zalo.
For the Poll resource and the Lấy Thông Tin Bình Chọn (Get Poll Information) operation, the node fetches detailed information about a specific poll by its ID. This can be used to monitor poll status, view results, or analyze participant responses.
Practical Example
- A community manager wants to display the current results of a poll in their workflow. They provide the poll ID, and the node returns all relevant details about that poll.
- An automated report system retrieves poll data periodically to track engagement metrics.
Properties
| Name | Meaning |
|---|---|
| ID Bình Chọn (poll_id) | The unique numeric identifier of the poll to retrieve information for. This property is required. |
Output
The node outputs an array of JSON objects, each representing the result of the executed operation per input item. For the "Lấy Thông Tin Bình Chọn" operation, the output JSON structure includes:
success: A boolean indicating if the API call was successful.response: An object containing detailed information about the poll as returned by the Zalo API. This typically includes poll question, options, votes, status, expiration, and other metadata.poll_id: The ID of the poll queried.
No binary data output is produced by this operation.
Example output JSON snippet:
{
"success": true,
"response": {
"question": "Your poll question here",
"options": [
{"option": "Option 1", "votes": 10},
{"option": "Option 2", "votes": 5}
],
"status": "active",
"expiredTime": 1680000000000,
...
},
"poll_id": 123456
}
Dependencies
- Requires valid Zalo API credentials including an API key credential with cookie, IMEI, and user agent information.
- The node uses the
zalo-api-finalpackage internally to interact with the Zalo API. - Proper configuration of the Zalo credential in n8n is necessary to authenticate requests.
- Network access to Zalo's API endpoints is required.
Troubleshooting
Common Issues:
- Invalid or expired credentials will cause authentication failures.
- Providing an incorrect or non-existent poll ID will result in errors or empty responses.
- Missing required parameters like
poll_idwill throw validation errors.
Error Messages:
"No API instance found. Please make sure to provide valid credentials."
Means the node could not initialize the Zalo API client due to missing or invalid credentials. Check your credential setup.- Errors related to parameter processing or API calls will include messages from the underlying API or node validation. Ensure all required inputs are correctly provided.
- If the node is set to continue on fail, errors will be included in the output JSON under an
errorfield instead of stopping execution.
Links and References
- Zalo Official Developer Documentation
- Zalo API Node Package (zalo-api-final) (for internal reference)
- n8n Documentation on Creating Custom Nodes