# Zalo OA

To integrate Zalo Official Account (OA) with XBot, businesses need to follow specific steps to ensure seamless communication between Zalo users and the bot. Here's a detailed guide on how to achieve this integration:

## Steps for Integrating Zalo OA with XBot

### **1. Register a Zalo OA Account**

Ensure that your business has a registered OA account with a subscription to a paid plan. You can find more details on the plans here: [Zalo OA Pricing](https://zalo.cloud/oa/pricing).

### **2. Create an App on Zalo**

* Navigate to the Zalo Developers site and create a new app.
* Follow the instructions to set up your app and obtain the necessary credentials.

### **3. Verify Webhook Domain**

* Set up your webhook URL, which will be used to receive events from Zalo.
* Verify the domain of your webhook URL as per Zalo’s guidelines.

### **4. Register to use API**

* Apply for the "User Management" API to get approval from Zalo for your OA account.
* This API will allow you to manage user interactions through your OA account.

### **5. Link App with OA Account**

* Connect your newly created app to your OA account by following the linking procedures in Zalo’s documentation.
* **Configure Webhook URL**:
  * Configure your webhook URL in the Zalo app settings.
  * This URL will be used by XBot to send event messages when users interact with your OA.

### **6. Enable Necessary Events**

* Ensure that the following events are enabled so that Zalo can send them to XBot:

  * `user_send_image`: Event when a user sends an image message.
  * `user_send_link`: Event when a user sends a link message.
  * `user_send_text`: Event when a user sends a text message.
  * `user_submit_info`: Event when a user shares information.
  * `user_send_file`: Event when a user sends a file attachment.

  These events ensure that whenever users interact through the Zalo OA by sending messages, links, images, files, or sharing information, these are promptly sent to XBot for processing.

### **7. Zalo Documentation**

* Refer to the Zalo documentation for detailed instructions on sending messages from OA: [Zalo Official Account Documentation](https://developers.zalo.me/docs/official-account/bat-dau/kham-pha).

<figure><img src="/files/nsrUAqauPhCAlSXilz24" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/8bPK7dFAGId02EPHKWrr" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/xTZdEVx0MdTb8MOCSvzY" alt=""><figcaption><p>OA API user management</p></figcaption></figure>

<figure><img src="/files/AFGdvP4DPvkCARrgOjwd" alt=""><figcaption><p>Link OA</p></figcaption></figure>

<figure><img src="/files/mjkmS5yidaYc1g1OIKxq" alt=""><figcaption><p>Access Token</p></figcaption></figure>


---

# 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.a4b.vn/xbot/features/communication-channels/zalo-oa.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.
