Zalo OA icon

Zalo OA

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

Overview

This node allows sending text messages to a group in Zalo Official Account (OA) via the Zalo OA API. It is useful for automating communication within Zalo groups, such as broadcasting announcements, updates, or alerts to all members of a specific group.

Typical use cases include:

  • Sending promotional or informational messages to customer groups.
  • Broadcasting event notifications or reminders to team groups.
  • Automating group chat interactions based on workflow triggers.

For example, you can configure this node to send a welcome message to a newly created group or notify a sales team about daily targets.

Properties

Name Meaning
Group ID The unique identifier of the target group that will receive the text message. This must be provided to specify which group to send the message to.
Nội Dung Tin Nhắn (Message Content) The actual text content of the message to be sent into the group. This is the body of the text message.

Output

The node outputs JSON data representing the response from the Zalo OA API after attempting to send the message. The structure typically includes fields indicating success status, message IDs, timestamps, or error details if the request failed.

No binary data output is produced by this operation.

Example output JSON structure (simplified):

{
  "message_id": "1234567890",
  "error": false,
  "message": "Message sent successfully"
}

If an error occurs, the output JSON will contain error information and suggestions.

Dependencies

  • Requires a valid Zalo Official Account API access token with permissions to send group messages.
  • The node uses HTTP POST requests to the Zalo OA API endpoint /message/group/text.
  • The access token must be configured either via credentials in n8n or environment variables.
  • No additional external dependencies beyond standard HTTP client libraries bundled with n8n.

Troubleshooting

  • Common issues:

    • Invalid or expired access token: Ensure your API key or token is current and has the necessary permissions.
    • Incorrect Group ID: Verify that the Group ID exists and the OA account has permission to send messages to it.
    • Message content empty or too long: Provide valid non-empty text content within allowed length limits.
    • Network or API errors: Check network connectivity and Zalo OA API service status.
  • Error messages:

    • Errors returned from the API are included in the output JSON under error and message fields.
    • If the node throws an error about missing binary data property, it indicates a misconfiguration in input data referencing binary fields.
    • For permission-related errors, verify that the OA account has granted "Manage group messages" rights and the access token scope is sufficient.
  • Resolution tips:

    • Refresh or reconfigure API credentials if authentication fails.
    • Double-check input parameters for correctness.
    • Consult Zalo OA API documentation for updated endpoint usage and limitations.

Links and References

Discussion