ก่อนใช้ Google API คุณต้องเปิดใช้ API ในโปรเจ็กต์ Google Cloud คุณเปิด API อย่างน้อย 1 รายการในโปรเจ็กต์ Google Cloud เดียวได้ หากยังไม่มีโปรเจ็กต์ Google Cloud โปรดดูสร้างโปรเจ็กต์ Cloud
วิธีเปิดใช้ API ในโปรเจ็กต์ Cloud
คอนโซล Google Cloud
- ในคอนโซล Google Cloud ให้ไปที่เมนู > ผลิตภัณฑ์เพิ่มเติม > Google Workspace > คลังผลิตภัณฑ์
- คลิก API ที่ต้องการเปิด
- คลิกเปิดใช้
- หากต้องการเปิดใช้ API เพิ่มเติม ให้ทำตามขั้นตอนเหล่านี้ซ้ำ
Google Cloud CLI
- ติดตั้งหรือเปิดอินเทอร์เฟซบรรทัดคำสั่ง (CLI) ของ Google Cloud
-
เรียกใช้คำสั่ง
services enable
โดยระบุบริการ API ที่จะเปิดใช้gcloud services enable API_SERVICE_ID
(ไม่บังคับ) ลองใช้ Google Workspace API ในแอปเวอร์ชันทดลอง
หากกำลังทดลองใช้ Google Workspace ให้ใช้ทางลัดต่อไปนี้ ซึ่งจะเปิดใช้ Google Workspace API ที่ได้รับความนิยม และสร้างข้อมูลเข้าสู่ระบบ OAuth ที่คุณใช้ได้
หากคุณกำลังพัฒนาแอปที่เข้าถึงข้อมูลของผู้ใช้ คุณต้องกำหนดค่าหน้าจอคำยินยอม OAuth ก่อนที่จะเปิดตัวแอป
คลิกปุ่มนี้เพื่อเลือกหรือสร้างโปรเจ็กต์ Google Cloud และเปิดใช้ Workspace API โดยอัตโนมัติ
ในกล่องโต้ตอบที่ปรากฏขึ้น ให้คลิกดาวน์โหลดการกำหนดค่าไคลเอ็นต์ แล้วบันทึกcredentials.json
ลงในไดเรกทอรีการทำงาน
ดูโปรแกรมสำรวจ Google Workspace APIs เพื่อดูรายการ API ทั้งหมดที่พร้อมใช้งาน และลองใช้วิธีการที่เฉพาะเจาะจงจากเบราว์เซอร์
API ที่เปิดใช้ (คลิกเพื่อขยาย)
ปุ่มนี้จะเปิดใช้ API ต่อไปนี้
- Admin SDK API
- Apps Script API
- Calendar API
- Chat API
- Classroom API
- Docs API
- API ไดรฟ์
- Forms API
- Gmail API
- API ส่วนเสริมของ Google Workspace
- Google Keep API
- REST API ของ Meet
- Sheets API
- Slides API
Google Workspace API
ใช้ลิงก์ Google Cloud Console ต่อไปนี้หรืออินเทอร์เฟซบรรทัดคำสั่ง (CLI) ของ Google Cloud เพื่อเปิดใช้ Google Workspace API ที่เฉพาะเจาะจงในโปรเจ็กต์ Cloud
Admin SDK API |
เปิดใช้ Admin SDK API
|
Alert Center API |
เปิดใช้ Alert Center API
|
Apps Script API |
เปิดใช้ Apps Script API
|
CalDAV API |
เปิดใช้ CalDAV API
|
Calendar API |
เปิดใช้ Calendar API
|
Chat API |
เปิดใช้ Chat API
|
Classroom API |
เปิดใช้ Classroom API
|
Cloud Identity API |
เปิดใช้ Cloud Identity API
|
Cloud Search API |
เปิดใช้ Cloud Search API
|
Docs API |
เปิดใช้ Docs API
|
Drive API |
เปิดใช้ Drive API
|
Drive Activity API |
เปิดใช้ Drive Activity API
|
Drive Labels API |
เปิดใช้ Drive Labels API
|
Forms API |
เปิดใช้ Forms API
|
Gmail API |
เปิดใช้ Gmail API
|
Groups Migration API |
เปิดใช้ Groups Migration API
|
Groups Settings API |
เปิดใช้ Groups Settings API
|
API ส่วนเสริมของ Google Workspace |
เปิดใช้ API ส่วนเสริมของ Google Workspace
|
Google Keep API |
เปิดใช้ Google Keep API
|
Enterprise License Manager API |
เปิดใช้ Enterprise License Manager API
|
Marketplace API |
เปิดใช้ Marketplace API
|
SDK ของ Marketplace |
เปิดใช้ Marketplace SDK
|
Meet REST API |
เปิดใช้ Meet REST API
|
People API |
เปิดใช้ People API
|
Postmaster Tools API |
เปิดใช้ Postmaster Tools API
|
Reseller API |
เปิดใช้ Reseller API
|
Sheets API |
เปิดใช้ Sheets API
|
Slides API |
เปิดใช้ Slides API
|
Tasks API |
เปิดใช้ Tasks API
|
Vault API |
เปิดใช้ Vault API
|
ขั้นตอนถัดไป
ดูวิธีการทำงานของการตรวจสอบสิทธิ์และการให้สิทธิ์ สำหรับ Google Workspace API