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 to send image messages to users. Specifically, the "Gửi Tin Nhắn Hình Ảnh" (Send Image Message) operation allows sending an image message to a specified user by their user ID. The image can be sent either by providing a direct URL or by referencing an image already uploaded to the Zalo OA platform via its image ID.

Common scenarios for this node include:

  • Customer service interactions where visual content needs to be shared with followers.
  • Transactional notifications that include images such as receipts or product photos.
  • Promotional campaigns that involve sending marketing images directly to users.

Practical example:

  • A business wants to send a promotional banner image to a follower who has shown interest in a product.
  • A support agent sends a screenshot or photo to assist a customer through the chat.

Properties

Name Meaning
Message Type Type of message to send. Options:
- Tin Tư Vấn (Customer Service)
- Tin Giao Dịch (Transaction)
- Tin Truyền Thông Cá Nhân (Promotion)
User ID The unique identifier of the user who will receive the image message.
Loại Hình Ảnh (Image Type) Source type of the image to send. Options:
- URL Hình Ảnh (Image URL)
- ID Hình Ảnh (Đã Upload) (Uploaded Image ID)
URL Hình Ảnh (Image URL) The direct URL of the image to be sent. Required if Image Type is "URL Hình Ảnh".
ID Hình Ảnh (Image ID) The ID of an image previously uploaded to Zalo OA. Required if Image Type is "ID Hình Ảnh".

Output

The node outputs JSON data containing the response from the Zalo OA API after attempting to send the image message. This typically includes information about the success or failure of the message delivery, message IDs, and any error details if applicable.

If the operation succeeds, the output JSON confirms the message was sent. If it fails, the output contains error information explaining the cause.

The node does not output binary data for this operation.

Dependencies

  • Requires a valid API access token credential for Zalo Official Account with appropriate permissions to send messages.
  • The node uses the Zalo OA API v3.0 endpoints for sending messages.
  • Network connectivity to https://openapi.zalo.me is required.
  • No additional external dependencies beyond standard HTTP request libraries bundled with n8n.

Troubleshooting

  • Common issues:

    • Invalid or expired access token: Ensure the API key/token used is valid and refreshed.
    • Incorrect user ID: Verify the recipient's user ID is correct and corresponds to a follower of the OA.
    • Image URL inaccessible: If using an image URL, ensure the URL is publicly accessible without authentication.
    • Using an invalid or non-existent image ID: Confirm the image ID exists and was successfully uploaded to Zalo OA.
    • Missing required parameters: Make sure all required fields are filled based on the selected image type.
  • Error messages:

    • Errors returned from the Zalo API will be included in the output JSON under an error field with descriptive messages.
    • Common suggestions include checking access permissions, verifying parameter correctness, and ensuring the image resource is available.

Links and References

Discussion