Zalo CN Poll icon

Zalo CN Poll

Quản bình chọn Zalo

Overview

This node integrates with the Zalo platform to manage polls within Zalo groups. Specifically, the "Poll" resource supports operations such as creating a poll, retrieving poll details, and locking a poll to prevent further votes.

The "Khóa Bình Chọn" (Lock Poll) operation locks an existing poll identified by its ID, effectively closing it so no more votes can be cast. This is useful in scenarios where you want to finalize poll results or stop voting after a deadline.

Practical examples:

  • Automatically lock a poll when a scheduled time expires.
  • Lock a poll after reaching a certain number of votes.
  • Programmatically close polls to prepare for result analysis.

Properties

Name Meaning
ID Bình Chọn The numeric ID of the poll to lock. This identifies which poll will be locked.

Output

The node outputs an array of JSON objects, each corresponding to an input item processed. For the "lockPoll" operation, each output JSON contains:

  • success: A boolean indicating if the lock operation succeeded.
  • response: The raw response from the Zalo API regarding the lock action.
  • poll_id: The ID of the poll that was locked.

No binary data is produced by this node.

Example output JSON:

{
  "success": true,
  "response": { /* Zalo API lock poll response object */ },
  "poll_id": 123456
}

Dependencies

  • Requires valid Zalo API credentials including authentication cookies, device IMEI, and user agent strings.
  • Uses the external zalo-api-final library to interact with Zalo's API.
  • The node expects these credentials to be configured in n8n beforehand.
  • No additional environment variables are explicitly required beyond credential setup.

Troubleshooting

  • Common issues:

    • Invalid or expired credentials may cause login failures.
    • Providing an incorrect or non-existent poll ID will likely cause API errors.
    • Missing required parameters (like poll ID) will throw validation errors.
  • Error messages:

    • "No API instance found. Please make sure to provide valid credentials."
      Means the node failed to initialize the Zalo API client due to missing or invalid credentials. Check your credential configuration.
    • Errors during the lock operation will be reported with their message; enabling "Continue On Fail" allows processing subsequent items despite errors.
    • If the poll ID parameter is missing or invalid, the node will throw an error indicating the required input is not provided.

Links and References

Discussion