ZaloOA icon

ZaloOA

Consume ZaloOA API

Overview

The ZaloOA node for n8n enables sending messages via the Zalo Official Account (OA) API. Specifically, with the Message resource and Text + Image operation, this node allows you to send a message containing both text and an image (or GIF) to a user or an anonymous recipient on Zalo. This is useful for customer engagement, notifications, marketing campaigns, or automated responses where rich media content enhances communication.

Practical examples:

  • Sending promotional banners with captions to users.
  • Delivering order confirmations with product images.
  • Responding to support queries with illustrative screenshots or GIFs.

Properties

Name Meaning
Authentication Select the authentication method. Options: Parameter Credentials, Predefined Credentials.
Base URL The base URL that serves the Zalo OA API. Only shown if "Parameter Credentials" is selected.
Access Token OA access token required for authenticating API requests. Only shown if "Parameter Credentials" is selected.
Send To Anonymous Whether the user is anonymous or not. If true, use "Anonymous ID" and "Conversation ID"; if false, use "User ID".
User ID User ID of Zalo. Required if sending to a non-anonymous user.
Anonymous ID The ID representing the anonymous user. Required if sending to an anonymous user.
Conversation ID The ID of the conversation. Required if sending to an anonymous user.
Text Title of the photo (text message). Maximum 2,000 characters.
Media Type Type of media to send. Options: Image, GIF.
Use URL Whether to use a direct URL for the attachment. If false, use Attachment's ID instead.
Attachment's URL The URL of the image to send. Required if "Use URL" is true.
Attachment's ID The ID of the image after using the upload API. Required if "Use URL" is false.
Width The width of the image (required only if Media Type is GIF).
Height The height of the image (required only if Media Type is GIF).

Output

The node outputs a json object containing the response from the Zalo OA API after attempting to send the text and image message. The structure typically includes:

  • Status code or success indicator
  • Message or error description
  • Any returned data such as message IDs or metadata

Note: The exact output fields depend on the Zalo OA API's response format.

Dependencies

  • External Service: Requires access to the Zalo Official Account API.
  • API Key: An OA access token is mandatory.
  • n8n Credentials: You may configure credentials either as parameters or predefined credentials in n8n.

Troubleshooting

Common Issues:

  • Invalid Access Token: Ensure your OA access token is correct and has not expired.
  • Missing Required Fields: Double-check that all required properties (e.g., User ID, Anonymous ID, Attachment's URL/ID) are provided based on your configuration.
  • Media Upload Errors: If using Attachment's ID, ensure the file was uploaded successfully beforehand.

Common Error Messages:

  • "Invalid OA access token": Check your access token and re-authenticate if necessary.
  • "User not found": Verify the User ID or Anonymous ID.
  • "Attachment not found": Ensure the Attachment's ID is valid and corresponds to an uploaded file.
  • "Missing required parameter": Review which required property is missing and provide it.

Links and References

Discussion