Zalo Group icon

Zalo Group

Quản lý nhóm Zalo

Overview

This node interacts with Zalo's group and poll features, specifically here focusing on the "Poll" resource and the "Khóa bình chọn" (Lock Poll) operation. The Lock Poll operation is used to close or lock an existing poll in a Zalo group, preventing further votes or changes. This is useful when you want to finalize poll results and stop additional input from participants.

Practical scenarios include:

  • Finalizing a decision-making poll after a deadline.
  • Preventing further voting once enough responses have been collected.
  • Managing group polls programmatically within automated workflows.

Properties

Name Meaning
ID bình chọn (poll_id) The numeric ID of the poll to be locked. This identifies which poll will be closed.

Output

The output JSON contains the following fields:

  • success: A boolean indicating whether the lock operation was successful (true).
  • response: The raw response object returned by the Zalo API after locking the poll. This typically includes confirmation details about the locked poll.
  • poll_id: The ID of the poll that was locked.

Example output structure:

{
  "success": true,
  "response": { /* API response data */ },
  "poll_id": 123456
}

No binary data output is produced by this operation.

Dependencies

  • Requires valid Zalo API credentials including cookie, IMEI, and user agent information for authentication.
  • Uses the external zca-js library to interact with the Zalo API.
  • The node expects these credentials to be configured in n8n under a generic API key credential for Zalo.
  • Proper network access to Zalo's API endpoints is necessary.

Troubleshooting

  • Common issues:

    • Invalid or expired credentials can cause authentication failures.
    • Providing a non-existent or incorrect poll ID will result in errors from the API.
    • Network connectivity problems may prevent communication with Zalo servers.
  • Error messages:

    • "No API instance found. Please make sure to provide valid credentials."
      Means the node could not authenticate with Zalo. Check your API credentials and ensure they are correctly set up.
    • Errors related to invalid poll IDs usually indicate the poll does not exist or you do not have permission to modify it.
    • If the node throws "Zalo API not initialized", it means the internal API client was not properly created due to missing or invalid credentials.
  • Resolution tips:

    • Verify and refresh your Zalo API credentials.
    • Confirm the poll ID exists and belongs to a group you manage.
    • Ensure your environment has internet access and no firewall blocks outgoing requests to Zalo.

Links and References

Discussion