Zalo OA icon

Zalo OA

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

Overview

This node interacts with the Zalo Official Account (OA) API to retrieve a list of tags associated with the OA. It is useful for workflows that need to manage or utilize user tags within Zalo OA, such as segmenting users, targeting messages, or organizing followers by tags.

A practical example: You want to fetch a paginated list of tags to display them in your application or use their IDs/names to assign tags to users in subsequent steps of your workflow.

Properties

Name Meaning
Số Lượng Tối Đa The starting position (offset) from which to begin fetching the tag list.
Số Lượng The number of tags to retrieve (limit/count).

Output

The output JSON contains the response from the Zalo OA API endpoint that returns the tag list. The main structure includes:

  • data: An array of tag objects.
  • Each tag object includes:
    • tag_id: The unique identifier of the tag.
    • tag_name: The name of the tag.
    • display_info: A string combining the tag ID and name for easy identification (e.g., "ID: 12345 - Name: VIP").
  • Additional metadata fields like message and example may be included to guide usage.

No binary data output is produced by this operation.

Dependencies

  • Requires an active and valid access token for the Zalo Official Account API.
  • The node uses HTTP requests to the Zalo OA API endpoint /tag/gettagsofoa.
  • Proper OAuth credentials or API keys must be configured in n8n to authenticate requests.
  • Environment variables or static workflow data may be used to store tokens and refresh tokens.

Troubleshooting

  • Common Issues:

    • Invalid or expired access token leading to authentication errors.
    • Incorrect offset or count parameters causing empty or partial results.
    • Insufficient permissions granted to the access token for reading tags.
  • Error Messages:

    • Errors related to API call failures will include messages like "Lỗi khi gọi API gettagsofoa v3.0" (Error calling API gettagsofoa v3.0).
    • If the API call fails, the node attempts a fallback to an older API version.
    • Error responses include suggestions to check token validity and OA access permissions.
  • Resolutions:

    • Ensure the access token is current and has the required scopes.
    • Verify the offset and count values are within acceptable ranges.
    • Confirm that the Zalo OA app has the necessary permissions enabled.
    • Review API documentation for any changes in endpoints or parameters.

Links and References

Discussion