> For the complete documentation index, see [llms.txt](https://apidocs.nhanh.vn/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://apidocs.nhanh.vn/v3/vpage/marketing/fb_ad_upload_image.md).

# Upload Facebook Ad image

* API này upload ảnh lên Facebook lấy imageHash, dùng để tạo ảnh cho quảng cáo, VD gửi [Facebook Marketing Message](/v3/vpage/marketing/fmm_campaign_create.md).

## Request

```curl
curl --location 'https://vpage.open.nhanh.vn/v3.0/marketing/fbaduploadimage?appId={{appId}}&businessId={{businessId}}' \
--header 'Authorization: {{accessToken}}' \
--data '{
  "bytes": "iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNkYAAAAAYAAjCB0C8AAAAASUVORK5CYII...",
  "adAccountId": "act_12345678",
  "pageId": "98764321"
}'
```

| Tham số           | Kiểu dữ liệu | Bắt buộc | Mô tả                                                                          |
| ----------------- | ------------ | -------- | ------------------------------------------------------------------------------ |
| **`bytes`**       | string       | Có       | Chuỗi base64 của tệp ảnh (giới hạn dung lượng tối đa **10MB** sau khi decode). |
| **`adAccountId`** | string       | Có       | ID tài khoản quảng cáo của Facebook (Ví dụ: `act_12345678`).                   |
| **`pageId`**      | string       | Có       | ID Trang Facebook.                                                             |

## Response

* Xem cấu trúc chung [tại đây](/v3/readme.md#response).

### Failed response

* Xem các mã lỗi chung [tại đây](/v3/readme.md#failed-response).

### Successful response

```json
{
  "code": 1,
  "data": {
      "imageHash": "(string)",
  }
}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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://apidocs.nhanh.vn/v3/vpage/marketing/fb_ad_upload_image.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.
