> 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>
