Zalo OA icon

Zalo OA

Tương tác với Zalo Official Account API

Overview

This node integrates with the Zalo Official Account (OA) API, enabling automation of various interactions and management tasks related to a Zalo OA. Specifically, the "Gán Tag Cho Người Theo Dõi" (Assign Tag to Follower) operation allows you to assign a tag to a follower by specifying their user ID and the tag ID. This is useful for segmenting followers, targeting specific groups for messaging campaigns, or organizing users based on interests or behaviors.

Practical examples:

  • Automatically tagging new followers based on their profile or behavior.
  • Segmenting users for personalized marketing messages.
  • Managing follower lists by categorizing them with tags for easier filtering.

Properties

Name Meaning
User ID The unique identifier of the follower (user) to whom the tag will be assigned.
Tag ID The identifier of the tag that will be assigned to the specified follower.

Output

The node outputs a JSON object representing the response from the Zalo OA API after attempting to assign the tag. This typically includes success status, any error messages, and additional metadata returned by the API.

Example output structure (simplified):

{
  "message": "Success",
  "error": 0,
  "data": {
    // Additional data about the tag assignment
  }
}

If an error occurs, the output JSON will contain an error field set to a non-zero value, a descriptive message, and possibly a response object with detailed API error information.

Dependencies

  • Requires an active Zalo Official Account API access token credential configured in n8n.
  • Uses the Zalo OA API endpoint at https://openapi.zalo.me/v3.0/oa.
  • Relies on HTTP POST requests with JSON payloads authenticated via the access token.

Troubleshooting

  • Common issues:

    • Invalid or expired access token: Ensure your API credentials are up-to-date and have the necessary permissions.
    • Incorrect user ID or tag ID: Verify that the IDs correspond to existing followers and tags in your Zalo OA.
    • API changes: The node attempts fallback strategies but always check the latest Zalo OA API documentation if errors persist.
  • Error messages:

    • "Lỗi khi gán tag cho người dùng" (Error assigning tag to user): Usually indicates invalid parameters or permission issues.
    • HTTP response errors with status codes and messages are logged; review these to identify problems such as rate limits or malformed requests.
  • Resolution tips:

    • Double-check the user ID and tag ID values.
    • Confirm that your Zalo OA has granted the required permissions to the API token.
    • Review API quota and usage limits.
    • Consult Zalo OA API documentation for updates or changes in tag assignment methods.

Links and References

Discussion