Zalo icon

Zalo

Send messages and interact with Zalo Official Account API

Overview

The Zalo node's "Send Image Message" operation allows you to send an image (with optional accompanying text) to a specific Zalo user via the Zalo Official Account API. This is useful for customer support, marketing, or notification scenarios where you want to deliver rich media content directly to users on Zalo.

Practical examples:

  • Sending product images in response to customer inquiries.
  • Delivering promotional banners or event invitations.
  • Sharing order confirmations with attached receipts or QR codes.

Properties

Name Type Meaning
User ID String The unique identifier of the Zalo user who will receive the image message. Required for targeting the recipient.
Image URL String The publicly accessible URL of the image to be sent. The image must be reachable by Zalo servers.
Message Text (Optional) String Optional text to accompany the image. Useful for providing context, captions, or additional information alongside the image.

Output

The node outputs a JSON object for each input item processed. The structure is as follows:

{
  "success": true,
  "response": {
    // Raw response from Zalo API, typically includes status and message IDs
  }
}
  • If the operation fails and "Continue On Fail" is enabled, the output will look like:
{
  "success": false,
  "error": "Error message describing what went wrong"
}

Dependencies

  • External Service: Requires access to the Zalo Official Account API.
  • API Credentials: You must configure Zalo API credentials (zaloApi) in n8n, including at least the Secret Key and valid access/refresh tokens.
  • Environment: The image URL provided must be accessible from the public internet so that Zalo can fetch it.

Troubleshooting

Common Issues:

  • Invalid or Expired Access Token: If your access token has expired or is invalid, the node will attempt to refresh it. If no refresh token is available, you'll need to reauthorize.
  • Image Not Accessible: If the image URL is not reachable by Zalo, the message will fail to send.
  • Incorrect User ID: Providing an incorrect or non-existent user ID will result in delivery failure.

Typical Error Messages:

  • "Your Zalo access token has expired and no refresh token is available."
    Resolution: Update your credentials and complete the PKCE authorization flow again.
  • "Failed to send image message to Zalo: ..."
    Resolution: Check the error details; verify your credentials, user ID, and image URL.
  • "Secret Key is required to exchange code for tokens."
    Resolution: Ensure your Zalo API credentials are correctly set up in n8n.

Links and References

Discussion