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" operation allows you to assign tags to followers by their user ID. This is useful for segmenting users, targeting specific groups for messaging campaigns, or organizing followers based on interests or behaviors.

Practical examples include:

  • Assigning promotional tags to users who have interacted with a campaign.
  • Tagging new followers automatically for personalized follow-up messages.
  • Managing user segments dynamically based on their activity or profile data.

Properties

Name Meaning
User ID The unique identifier of the follower to whom the tag will be assigned.
Tag ID The identifier of the tag that needs to be assigned to the follower.

Output

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

If the tag assignment fails, the output JSON contains an error field set to true, a descriptive message, the raw API response data, and a suggestion to help resolve the issue.

No binary data output is involved in this operation.

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/v2.0/oa.
  • Relies on HTTP POST requests with JSON payloads authenticated via the access token.

Troubleshooting

  • Common Issues:

    • Invalid or expired access token leading to authentication errors.
    • Incorrect userId or tagId values causing API failures.
    • API version changes requiring use of tag_name instead of tag_id.
  • Error Messages and Resolutions:

    • "Lỗi khi gán tag cho người dùng" (Error assigning tag): Check that the userId and tagId or tagName are correct and exist in your OA.
    • API response status codes indicating permission issues: Ensure the access token has sufficient permissions to manage tags.
    • If the first attempt using tag_id fails, the node tries again using tag_name due to API v3 requirements; if both fail, review tag identifiers and API documentation.

Links and References

Discussion