> For the complete documentation index, see [llms.txt](https://docs.icpc1hn.work/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.icpc1hn.work/ung-dung-n8n/tao-api-key-cua-google.md).

# Tạo API key của Google

**B1:** Đăng nhập vào tài khoản Google

Truy cập vào [console.cloud.google.com](https://console.cloud.google.com/projectselector2/apis/dashboard?pli=1\&invt=Abuysg\&supportedpurview=project\&allowsmanagementprojects=true) sau đó nhấn tạo **“New Project”** giao diện sẽ như ảnh dưới, sau đó nhấn tạo và chọn **“Create”.** Nếu đã có sẵn Project thì chọn vào Project đó

*Ví dụ chọn "GoogleMailtoSheet" như ảnh*

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

Đặt tên **Project** ⇒ sau đó bấm **Create**

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

**B2: Tạo Credentials key**

Chọn **APIs & Services** hoặc theo link sau <https://console.cloud.google.com/apis/credentials>

Nhấn vào nút **“Create credentials”** chọn **OAuth client ID**

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

Chọn **Configue consent screen**

<figure><img src="/files/7Gycpn5Gfo2om76yUDMu" alt=""><figcaption></figcaption></figure>

Chọn **Get started**

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

Nhập tên **App name** + chọn **gmail** của bạn

<figure><img src="/files/6X4Wc4eZWcSWmMUn5HNc" alt=""><figcaption></figcaption></figure>

Tích chọn **External** ⇒ **Next**

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

**Contact Infomation** chọn **Gmail** của bạn ⇒ bấm **Next** sau đó chọn **Create**

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

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

Sau khi thao tác xong, chọn **Create credentials ⇒ chọn OAuth client ID ⇒ chọn Web application ⇒** Nhập **Name** (có thể để mặc định như ảnh)

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

Trong Authorized redirect URIs nhập <https://n8n.cpc1hn.com/rest/oauth2-credential/callback> sau đó chọn Create

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

Sau khi tạo xong sẽ sinh ra **Client ID** và **Client secret** <mark style="color:$danger;">(lưu ý bảo mật mã này không chia sẻ cho người khác)</mark>

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


---

# 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://docs.icpc1hn.work/ung-dung-n8n/tao-api-key-cua-google.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.
