Zalo Group icon

Zalo Group

Quản lý nhóm Zalo

Overview

This node interacts with Zalo's Poll feature within groups. Specifically, the "Lấy thông tin bình chọn" (Get poll information) operation retrieves detailed information about a specific poll by its ID. This is useful for scenarios where you want to fetch the current state, options, votes, or metadata of a poll created in a Zalo group.

Practical examples:

  • Fetching poll results to display them in a dashboard.
  • Monitoring poll status and details for automated reporting.
  • Integrating poll data into other workflows or notifications.

Properties

Name Meaning
ID bình chọn (poll_id) The numeric ID of the poll to retrieve information for. This is required to specify which poll's details to fetch.

Output

The output JSON contains:

  • success: A boolean indicating if the request was successful.
  • response: An object containing detailed information about the poll, including its question, options, votes, status, and other metadata as returned by the Zalo API.
  • poll_id: The ID of the poll that was queried.

Example output structure (simplified):

{
  "success": true,
  "response": {
    "question": "Your poll question",
    "options": [
      {"option": "Option 1", "votes": 10},
      {"option": "Option 2", "votes": 5}
    ],
    "status": "active",
    "createdTime": 1234567890,
    ...
  },
  "poll_id": 12345
}

No binary data output is involved in this operation.

Dependencies

  • Requires valid Zalo API credentials with an API key credential that includes cookie, IMEI, and user agent information.
  • The node uses the zca-js library to interact with the Zalo API.
  • Proper configuration of the Zalo API credential in n8n is necessary to authenticate requests.

Troubleshooting

  • Common issues:

    • Invalid or expired credentials may cause authentication failures.
    • Providing an incorrect or non-existent poll ID will likely result in errors or empty responses.
    • Network connectivity issues can prevent communication with the Zalo API.
  • Error messages:

    • "Zalo API not initialized": Indicates missing or invalid credentials; ensure the API key credential is correctly set up.
    • Errors related to poll ID: Verify that the poll ID is correct and exists.
    • General API errors: Check the Zalo API status and your network connection.
  • Resolution tips:

    • Double-check the poll ID input.
    • Refresh or reconfigure the Zalo API credentials.
    • Review logs for detailed error messages.

Links and References

Discussion