# Gửi tin tư vấn dạng hình ảnh

{% hint style="info" %}
**Lưu ý:**

* Đối với các API sử dụng cho Shop thì API\_KEY: [`<api_key>`](https://docs.etelecom.vn/tich-hop-api/shop/tai-khoan#api-key).Thông tin base\_url của [Shop](https://docs.etelecom.vn/tich-hop-api/shop/tai-khoan)
* Đối với các API sử dụng cho Partner thì API\_KEY: [`<shop_key>`](https://docs.etelecom.vn/tich-hop-api/partner/su-dung#ket-noi-lan-thu-hai-tro-di).Thông tin base\_url của [Partner](https://docs.etelecom.vn/tich-hop-api/partner/tai-khoan)
  {% endhint %}

## POST $BASE\_URL.Zalo/OASendImage

> OASendImage

```json
{"openapi":"3.1.1","info":{"title":"API Document","version":"v1"},"tags":[{"name":"Zalo"}],"paths":{"$BASE_URL.Zalo/OASendImage":{"post":{"tags":["Zalo"],"summary":"OASendImage","operationId":"shop.Zalo-OASendImage","responses":{"200":{"description":"A successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/mrZlOAConversation"}}}}},"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/mrOASendImageRequest"}}},"required":true}}}},"components":{"schemas":{"mrZlOAConversation":{"type":"object","properties":{"direction":{"$ref":"#/components/schemas/nzMessageDirection"},"msg_id":{"type":"string"},"oa_id":{"type":"string","format":"int64"},"quota":{"$ref":"#/components/schemas/mrZlQuota"},"recipient_id":{"type":"string","format":"int64"},"sender_id":{"type":"string","format":"int64"},"shop_id":{"type":"string","format":"int64"},"type":{"$ref":"#/components/schemas/vqUIDType"},"user_id":{"type":"string","format":"int64"},"wl_partner_id":{"description":"ID           dot.ID                             `json:\"id\"`\n","type":"string","format":"int64"},"zl_user_id":{"type":"string","format":"int64"}}},"nzMessageDirection":{"type":"string","enum":["in","out"]},"mrZlQuota":{"type":"object","properties":{"expired_date":{"type":"string"},"owner_id":{"type":"string"},"owner_type":{"type":"string"},"quota_type":{"type":"string"},"remain":{"type":"string"},"total":{"type":"string"}}},"vqUIDType":{"type":"string","enum":["unknown","text","audio","video","photo","GIF","link","file","sticker","location","business_card"]},"mrOASendImageRequest":{"type":"object","properties":{"message":{"$ref":"#/components/schemas/mrMessageImage"},"oa_id":{"type":"string","format":"int64"},"recipient":{"$ref":"#/components/schemas/mrRecipient"}}},"mrMessageImage":{"type":"object","properties":{"attachment_id":{"type":"string"},"buttons":{"type":"array","items":{"$ref":"#/components/schemas/mrButtonAttachment"}},"image_url":{"type":"string"},"text":{"type":"string"}}},"mrButtonAttachment":{"type":"object","properties":{"payload":{"$ref":"#/components/schemas/mrButtonPayload"},"title":{"type":"string"},"type":{"$ref":"#/components/schemas/aiTemplateTxnButtonType"}}},"mrButtonPayload":{"type":"object","properties":{"callback":{"type":"string"},"content":{"type":"string"},"phone_code":{"type":"string"},"url":{"type":"string"}}},"aiTemplateTxnButtonType":{"type":"string","enum":["unknown","oa.open.url","oa.query.show","oa.query.hide","oa.open.sms","oa.open.phone"]},"mrRecipient":{"type":"object","properties":{"user_id":{"type":"string","format":"int64"}}}}}}
```

\
**Request:**

```json
curl --location 'BASE_URL.Zalo/OASendImage' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'Authorization: Bearer $API_KEY' \
--data '{
  "message": {
    "attachment_id": "string",
    "image_url": "string",
     "text": "string"
     "buttons": [
      {
        "payload": {
          "callback": "string",
          "content": "string",
          "phone_code": "string",
          "url": "string"
        },
        "title": "string",
        "type": "unknown"
      }
    ]
},
  "oa_id": "string",
  "recipient": {
  "user_id": "string"
}
  }
}'
```

**Response:**

```json
{
  "direction": "in",
  "msg_id": "string",
  "oa_id": "string",
  "quota": {
    "expired_date": "string",
    "owner_id": "string",
    "owner_type": "string",
    "quota_type": "string",
    "remain": "string",
    "total": "string"
  },
  "recipient_id": "string",
  "sender_id": "string",
  "shop_id": "string",
  "type": "unknown",
  "user_id": "string",
  "wl_partner_id": "string",
  "zl_user_id": "string"
}
```

**Cấu trúc body của request**

<table><thead><tr><th width="234.33333333333331">Tham số</th><th width="201">Kiểu dữ liệu</th><th>Mô tả</th></tr></thead><tbody><tr><td>attachment_id</td><td>string</td><td>ID hình ảnh, có được khi dùng API upload</td></tr><tr><td>image_url</td><td>string</td><td>URL hình ảnh</td></tr><tr><td>text</td><td>string</td><td>Tiêu đề của ảnh<br>Giới hạn tối đa là 2.000 ký tự</td></tr><tr><td>oa_id</td><td>int64</td><td>ID của OA</td></tr><tr><td>user_id</td><td>string</td><td>ID người dùng Zalo</td></tr><tr><td>type</td><td>string</td><td>Loại action sẽ thực hiện khi người dùng bấm vào</td></tr><tr><td>title</td><td>string</td><td>Nội dung chữ trên nút</td></tr><tr><td>payload</td><td></td><td>Dữ liệu của action. Cấu trúc của payload phải phù hợp với từng loại action và được cho ở bảng bên dưới</td></tr></tbody></table>

**Cấu trúc cho các loại payload action được hỗ trợ**

<table><thead><tr><th width="177.53328450520831">Giá trị type</th><th width="104.20001220703125">Kiểu dữ liệu</th><th>Giá trị payload và kết quả khi người dùng bấm vào</th></tr></thead><tbody><tr><td>oa.open.url</td><td>string</td><td><p>Data là một Url sẽ được mở trong ứng dụng Zalo khi người dùng bấm vào button. Ví dụ:<br><code>{</code><br><code>"title": "OPEN URL",</code><br><code>"payload" : {</code><br><code>"url": "https://developers.zalo.me/"</code><br><code>},</code><br><code>"type": "oa.open.url"</code><br><code>}</code><br></p><ul><li><strong>Chú ý:</strong>  Giới hạn cho thuộc tính "title" là 100 kí tự.</li></ul></td></tr><tr><td>oa.query.show</td><td>string</td><td><p>Data là một chuỗi ký tự ví dụ “#callback_data”. Khi người dùng bấm vào button, hệ thống sẽ gửi một tin nhắn có nội dung chứa trong data từ người dùng đến Official Account. Tin nhắn này sẽ hiện trên cửa sổ chat trên máy của người dùng. Ví dụ:<br><code>{</code><br><code>"title": "QUERY SHOW",</code><br><code>"type": "oa.query.show",</code><br><code>"payload": "#callback_data"</code><br><code>}</code><br></p><ul><li><p><strong>Chú ý:</strong>  </p><ul><li>Giới hạn cho thuộc tính "title" là 100 kí tự.</li><li>Giới hạn cho thuộc tính "payload" là 1000 kí tự.</li></ul></li></ul></td></tr><tr><td>oa.query.hide</td><td>string</td><td><p>Data là một chuỗi ký tự ví dụ “#callback_data”. Khi người dùng bấm vào button, hệ thống sẽ gửi một tin nhắn có nội dung chứa trong data từ người dùng đến Official Account. Tin nhắn này sẽ bị ẩn trên cửa sổ chat trên máy của người dùng. Ví dụ:<br><code>{</code><br><code>"title": "QUERY HIDE",</code><br><code>"type": "oa.query.hide",</code><br><code>"payload": "#callback_data"</code><br><code>}</code><br></p><ul><li><p><strong>Chú ý:</strong>  </p><ul><li>Giới hạn cho thuộc tính "title" là 100 kí tự.</li><li>Giới hạn cho thuộc tính "payload" là 1000 kí tự.</li></ul></li></ul></td></tr><tr><td>oa.open.sms</td><td>json object</td><td><p>Data đối tượng json chứa 2 thuộc tính “content” và “phoneCode”. Ví dụ:<br><code>{</code><br><code>"title": "OPEN SMS",</code><br><code>"type": "oa.open.sms",</code><br><code>"payload": {</code><br><code>"content":"alo",</code><br><code>"phone_code":""</code><br><code>}</code><br><code>}</code><br></p><p>Khi người dùng click vào button, cửa sổ sms trên điện thoại của người dùng sẽ được mở với 2 thông tin sẵn có là phone code và nội dung tin nhắn trong data.</p><ul><li><p><strong>Chú ý:</strong></p><ul><li>Giới hạn cho thuộc tính "title" là 100 kí tự.</li><li>Thuộc tính "content" có giới hạn là 160 kí tự.</li></ul></li></ul></td></tr><tr><td>oa.open.phone</td><td>json object</td><td><p>Data số điện thoại sẽ nhập vào khi bật ứng dụng gọi điện, ví dụ:<br><code>{</code><br><code>"title": "OPEN PHONE",</code><br><code>"type": "oa.open.phone",</code><br><code>"payload":{</code><br><code>"phone_code":""</code><br><code>}</code><br><code>}</code></p><p>Khi người dùng click vào button, cửa sổ call trên điện thoại của người dùng sẽ được mở với thông tin sẵn có là phone number trong data.</p><ul><li><strong>Chú ý:</strong>  Giới hạn cho thuộc tính "title" là 100 kí tự.</li></ul></td></tr></tbody></table>

**Cấu trúc thuộc tính dữ liệu trả về**

<table><thead><tr><th width="234.33333333333331">Tham số</th><th width="191">Kiểu dữ liệu</th><th>Mô tả</th></tr></thead><tbody><tr><td>direction</td><td>string (nzMessageDirection)</td><td><mark style="color:red;"><strong><code>in</code></strong></mark><br><mark style="color:red;"><strong><code>out</code></strong></mark></td></tr><tr><td>msg_id</td><td>string</td><td>ID của thông báo</td></tr><tr><td>oa_id</td><td>string</td><td>ID của OA</td></tr><tr><td>expired_date</td><td>string</td><td>Ngày hết hạn sử dụng tin Tư vấn miễn phí theo gói dịch vụ OA</td></tr><tr><td>remain</td><td>string</td><td><ul><li>Số lượt gửi tin tin Tư vấn miễn phí trong hạn mức 8 tin 48 giờ còn lại (Tin gửi ra là tin trong khung 8 tin 48h - “reply”)</li><li>Số lượt gửi tin Tư vấn miễn phí theo gói dịch vụ OA còn lại (Tin gửi ra là tin nằm trong hạn mức miễn phí theo gói - “sub_quota”)</li></ul></td></tr><tr><td>total</td><td>string</td><td>Tổng số lượng gửi tin Tư vấn miễn phí theo gói dịch vụ OA</td></tr><tr><td>owner_id</td><td></td><td>ID thực thể sở hữu Quota Package <br>Giá trị: OA ID hoặc App ID</td></tr><tr><td>owner_type</td><td>string</td><td>Thực thể sở hữu Quota Package <br>Giá trị:<br>OA: Thực thể sở hữu là OA<br>App: Thực thể sở hữu là App</td></tr><tr><td>quota_type</td><td>string</td><td>Nguồn quota sử dụng Mang giá trị:<br><strong>“reply”</strong>: Tin gửi ra là tin trong khung 8 tin 48h<br><strong>“sub_quota”</strong>: Tin gửi ra là tin nằm trong hạn mức miễn phí theo gói<br><strong>“purchase_quota”</strong>: Tin gửi ra là tin nằm trong hạn mức gói tính năng lẻ<br><strong>“reward_quota”</strong>: Tin gửi ra là tin nằm trong hạn mức Redeem code</td></tr><tr><td>recipient_id</td><td>string</td><td>ID của người nhận</td></tr><tr><td>sender_id</td><td>string</td><td>ID người gửi</td></tr><tr><td>shop_id</td><td>string</td><td>ID của shop trên eTelecom</td></tr><tr><td>type</td><td>string (vqUIDType)</td><td><mark style="color:red;"><strong><code>"unknown" "text" "audio" "video" "photo" "GIF" "link" "file" "sticker" "location" "business_card"</code></strong></mark></td></tr><tr><td>user_id</td><td>string</td><td>ID user trên eTelecom</td></tr></tbody></table>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.etelecom.vn/tich-hop-api/zalo-cloud/zalo-cloud-api/gui-tin-tu-van-dang-hinh-anh.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
