Zalo OA icon

Zalo OA

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

Zalo OA → Gửi Tin Nhắn Hình Ảnh

AI-generated

Summary

Send an image message to a specified Zalo user via a Zalo Official Account with customizable message type and image source.

Inputs

  • User ID (required) — The Zalo user ID of the recipient who will receive the image message.
  • Message Type — The category of message being sent, affecting message handling and display. Options are 'Tin Tư Vấn (Customer Service)', 'Tin Giao Dịch (Transaction)', and 'Tin Truyền Thông Cá Nhân (Promotion)'. Defaults to 'Tin Tư Vấn (Customer Service)'.
  • Loại Hình Ảnh (Image Type) — Specifies the source type of the image: either a publicly accessible URL or an uploaded image ID.
  • URL Hình Ảnh (Image URL) (required) — The publicly accessible URL of the image to send. Required if Image Type is set to 'URL Hình Ảnh'.
  • ID Hình Ảnh (Image ID) (required) — The ID of an image that was previously uploaded to the Zalo Official Account. Required if Image Type is set to 'ID Hình Ảnh (Đã Upload)'.

Output shape

a single JSON object representing the API response from the Zalo Official Account indicating success, failure, and potentially message metadata.

The output includes the full response from the Zalo Official Account API endpoint used to send the image message (POST to /message/{messageType}). It indicates whether the message sending succeeded or failed. The response format depends on Zalo's API specifications and may include message IDs or error codes.

Examples

Example 1: Send an image message to user '123456789' using a URL image for a customer service message.

Set 'User ID' to '123456789', 'Message Type' to 'Tin Tư Vấn (Customer Service)', 'Image Type' to 'URL Hình Ảnh', and 'URL Hình Ảnh' to the image URL.

Example 2: Send a promotional image message using an uploaded image ID.

Set 'User ID' to the recipient's ID, 'Message Type' to 'Tin Truyền Thông Cá Nhân (Promotion)', 'Image Type' to 'ID Hình Ảnh', and provide the uploaded image ID.

Discussion