เปิดใช้ Google Workspace API

ก่อนใช้ Google API คุณต้องเปิดใช้ API ในโปรเจ็กต์ Google Cloud คุณเปิด API อย่างน้อย 1 รายการในโปรเจ็กต์ Google Cloud เดียวได้ หากยังไม่มีโปรเจ็กต์ Google Cloud โปรดดูสร้างโปรเจ็กต์ Cloud

วิธีเปิดใช้ API ในโปรเจ็กต์ Cloud

คอนโซล Google Cloud

  1. ในคอนโซล Google Cloud ให้ไปที่เมนู > ผลิตภัณฑ์เพิ่มเติม > Google Workspace > คลังผลิตภัณฑ์

    ไปที่คลังผลิตภัณฑ์

  2. คลิก API ที่ต้องการเปิด
  3. คลิกเปิดใช้
  4. หากต้องการเปิดใช้ API เพิ่มเติม ให้ทำตามขั้นตอนเหล่านี้ซ้ำ

Google Cloud CLI

  1. ติดตั้งหรือเปิดอินเทอร์เฟซบรรทัดคำสั่ง (CLI) ของ Google Cloud
  2. เรียกใช้คำสั่ง services enable โดยระบุบริการ API ที่จะเปิดใช้

    gcloud services enable API_SERVICE_ID

(ไม่บังคับ) ลองใช้ Google Workspace API ในแอปเวอร์ชันทดลอง

หากกำลังทดลองใช้ Google Workspace ให้ใช้ทางลัดต่อไปนี้ ซึ่งจะเปิดใช้ Google Workspace API ที่ได้รับความนิยม และสร้างข้อมูลเข้าสู่ระบบ OAuth ที่คุณใช้ได้

หากคุณกำลังพัฒนาแอปที่เข้าถึงข้อมูลของผู้ใช้ คุณต้องกำหนดค่าหน้าจอคำยินยอม OAuth ก่อนที่จะเปิดตัวแอป

คลิกปุ่มนี้เพื่อเลือกหรือสร้างโปรเจ็กต์ Google Cloud และเปิดใช้ Workspace API โดยอัตโนมัติ

เปิดใช้ 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
gcloud services enable admin.googleapis.com
เปิดใช้ Alert Center API
gcloud services enable alertcenter.googleapis.com
เปิดใช้ Apps Script API
gcloud services enable script.googleapis.com
เปิดใช้ CalDAV API
gcloud services enable caldav.googleapis.com
เปิดใช้ Calendar API
gcloud services enable calendar-json.googleapis.com
เปิดใช้ Chat API
gcloud services enable chat.googleapis.com
เปิดใช้ Classroom API
gcloud services enable classroom.googleapis.com
เปิดใช้ Cloud Identity API
gcloud services enable cloudidentity.googleapis.com
เปิดใช้ Cloud Search API
gcloud services enable cloudsearch.googleapis.com
เปิดใช้ Docs API
gcloud services enable docs.googleapis.com
เปิดใช้ Drive API
gcloud services enable drive.googleapis.com
เปิดใช้ Drive Activity API
gcloud services enable driveactivity.googleapis.com
เปิดใช้ Drive Labels API
gcloud services enable drivelabels.googleapis.com
เปิดใช้ Forms API
gcloud services enable forms.googleapis.com
เปิดใช้ Gmail API
gcloud services enable gmail.googleapis.com
เปิดใช้ Groups Migration API
gcloud services enable groupsmigration.googleapis.com
เปิดใช้ Groups Settings API
gcloud services enable groupssettings.googleapis.com
เปิดใช้ API ส่วนเสริมของ Google Workspace
gcloud services enable gsuiteaddons.googleapis.com
เปิดใช้ Google Keep API
gcloud services enable keep.googleapis.com
เปิดใช้ Enterprise License Manager API
gcloud services enable licensing.googleapis.com
เปิดใช้ Marketplace API
gcloud services enable appsmarket.googleapis.com
เปิดใช้ Marketplace SDK
gcloud services enable appsmarket-component.googleapis.com
เปิดใช้ Meet REST API
gcloud services enable meet.googleapis.com
เปิดใช้ People API
gcloud services enable people.googleapis.com
เปิดใช้ Postmaster Tools API
gcloud services enable gmailpostmastertools.googleapis.com
เปิดใช้ Reseller API
gcloud services enable reseller.googleapis.com
เปิดใช้ Sheets API
gcloud services enable sheets.googleapis.com
เปิดใช้ Slides API
gcloud services enable slides.googleapis.com
เปิดใช้ Tasks API
gcloud services enable tasks.googleapis.com
เปิดใช้ Vault API
gcloud services enable vault.googleapis.com

ขั้นตอนถัดไป

ดูวิธีการทำงานของการตรวจสอบสิทธิ์และการให้สิทธิ์ สำหรับ Google Workspace API