# AntCRM - Hướng dẫn kết nối tài khoản email Office 365 business vào CRM

Để tích hợp được email **Office 365 Business** chúng ta cần có 3 thông tin từ **Bot (Application)**:

* **Client ID**
* **Client Secret**
* **Tenant**

1. **Cách tạo Bot (Application)**

**Bước 1:** Vào link[ https://entra.microsoft.com/](https://entra.microsoft.com/)

**Bước 2:** Chọn **Application -> App registrations** để tạo Bot (Application)

**Bước 3:** Chọn **New registration**

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

**Bước 4:** Đặt tên cho Bot và chọn option 3 như hình dưới

**Bước 5:** Tại **Redirect URI**: Chọn web và điền[ https://beeiq.co/oauth2/redirect.html](https://beeiq.co/oauth2/redirect.html) và <https://offic.vn/oauth2/redirect.html> vào&#x20;

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

**Bước 6:** Chọn **Register**

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

Lúc này chúng ta đã có thông tin của Client ID và Tenant ID

**Bước 7:** Chọn **API permission -> Add a permission**&#x20;

**Bước 8:** Chọn **Microsoft Graph -> Delegated permissions**

**Bước 9:** Gõ các quyền dưới đây và tích chọn -> **Add permission**

* Calendars.Read
* Calendars.ReadWrite
* IMAP.AccessAsUser.All
* Mail.ReadWrite
* Mail.Send
* offline\_access
* openid
* profile
* SMTP.Send
* User.Read

**Bước 10:** Chọn **Certificates & secrets -> New client secret** -> Điền mô tả và thời hạn của key -> **Add**

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

Ngay lúc này chúng ta sẽ lấy được giá trị của **Client Secret**, copy lại giá trị này để nhập

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

2. **Tích hợp vào CRM**

**Bước 1:** Vào **Thiết lập -> Hội thoại đa kênh -> Tích hợp Shared Mailbox**

**Bước 2:** Chọn **thêm Trang**

<figure><img src="/files/56Ryj1ORO9BhOfOoIx12" alt=""><figcaption></figcaption></figure>

Bước 3: Chọn **Email Microsoft Office 365** - Điền 3 thông số&#x20;

* **Client ID**
* **Client Secret**
* **Tenant**

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

**Bước 4:** Bấm tích hợp

**Bước 5:** Gửi 3 thông số này cho support Antbuddy (Kênh chat zalo) để được hỗ trợ add vào database


---

# 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.antbuddy.com/tai-lieu-antbuddy-huong-dan-su-dung-antbuddy-docs-user-guide/antcrm-huong-dan-ket-noi-tai-khoan-email-office-365-business-vao-crm.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.
