Mengaktifkan Google Workspace API

Sebelum menggunakan Google API, Anda harus mengaktifkannya di project Google Cloud. Anda dapat mengaktifkan satu atau beberapa API dalam satu project Google Cloud. Jika Anda belum memiliki project Google Cloud, lihat Membuat project Cloud.

Untuk mengaktifkan API di project Cloud Anda:

Konsol Google Cloud

  1. Di Konsol Google Cloud, buka Menu > APIs & Services > Library > Google Workspace.

    Buka Library API

  2. Klik API yang ingin Anda aktifkan.
  3. Klik Enable.
  4. Untuk mengaktifkan API lainnya, ulangi langkah-langkah ini.

Google Cloud CLI

  1. Instal atau buka Antarmuka Command Line (CLI) Google Cloud.
  2. Jalankan perintah services enable, dengan menentukan layanan API yang akan diaktifkan.

    gcloud services enable API_SERVICE_ID

API yang telah diaktifkan di Google AI Studio

Saat membangun aplikasi web di Google AI Studio, Anda tidak perlu mengaktifkan Google Workspace API yang didukung secara manual di Konsol Google Cloud. API berikut telah diaktifkan sebelumnya di project Paket Starter yang dikelola Google:

  • Google Calendar API (calendar-json.googleapis.com)
  • Google Docs API (docs.googleapis.com)
  • Google Drive API (drive.googleapis.com)
  • Google Forms API (forms.googleapis.com)
  • Gmail API (gmail.googleapis.com)
  • Google Picker API (picker.googleapis.com)
  • Google Sheets API (sheets.googleapis.com)
  • Google Slides API (slides.googleapis.com)
  • Google Tasks API (tasks.googleapis.com)

Dalam project Tingkat Pemula, Google Workspace API hanya mendukung OAuth 2.0 sisi klien. Misalnya, Google Picker API menggunakan token akses OAuth 2.0, bukan kunci API developer, dan akun layanan atau penyimpanan rahasia klien OAuth di Secret Manager tidak didukung. Jika Anda memerlukan kredensial sisi server, kunci API, atau API tambahan seperti Admin SDK API atau Google Apps Script API, Anda dapat mengupgrade project Tingkat Pemula ke project Cloud standar dan mengonfigurasinya secara manual.

Untuk mengetahui detail tentang kuota dan fitur Tingkat Pemula, lihat Ringkasan Tingkat Pemula dan Men-deploy aplikasi web dari Google AI Studio.

(Opsional) Mencoba Google Workspace API di aplikasi eksperimental

Jika Anda bereksperimen dengan Google Workspace, gunakan pintasan berikut, yang mengaktifkan Google Workspace API populer, dan membuat kredensial OAuth yang dapat Anda gunakan.

Jika Anda mengembangkan aplikasi yang mengakses informasi pengguna, Anda harus mengonfigurasi layar izin OAuth sebelum merilis aplikasi.

Klik tombol ini untuk memilih atau membuat project Google Cloud, dan otomatis mengaktifkan Workspace API:

Mengaktifkan Workspace API

Dalam dialog yang muncul, klik Download client configuration dan simpan credentials.json ke direktori kerja Anda.

Lihat APIs Explorer Google Workspace untuk mengetahui daftar lengkap semua API yang tersedia, dan untuk mencoba metode tertentu dari browser Anda.

API yang diaktifkan (klik untuk meluaskan)

Tombol ini mengaktifkan API berikut:

  • Admin SDK API
  • Apps Script API
  • Calendar API
  • Chat API
  • Classroom API
  • Docs API
  • Drive API
  • Forms API
  • Gmail API
  • Google Workspace Add-ons API
  • Google Keep API
  • REST API Meet
  • Sheets API
  • Slides API

Google Workspace API

Gunakan link konsol Google Cloud berikut atau Antarmuka Command Line (CLI) Google Cloud untuk mengaktifkan API Google Workspace tertentu di project Cloud Anda.

Aktifkan Admin SDK API
gcloud services enable admin.googleapis.com
Aktifkan Alert Center API
gcloud services enable alertcenter.googleapis.com
Aktifkan Apps Script API
gcloud services enable script.googleapis.com
Mengaktifkan CalDAV API
gcloud services enable caldav.googleapis.com
Mengaktifkan Calendar API
gcloud services enable calendar-json.googleapis.com
Aktifkan Chat API
gcloud services enable chat.googleapis.com
Aktifkan Classroom API
gcloud services enable classroom.googleapis.com
Mengaktifkan Cloud Identity API
gcloud services enable cloudidentity.googleapis.com
Mengaktifkan Cloud Search API
gcloud services enable cloudsearch.googleapis.com
Mengaktifkan Docs API
gcloud services enable docs.googleapis.com
Aktifkan Drive API
gcloud services enable drive.googleapis.com
Mengaktifkan Drive Activity API
gcloud services enable driveactivity.googleapis.com
Mengaktifkan Drive Labels API
gcloud services enable drivelabels.googleapis.com
Mengaktifkan Forms API
gcloud services enable forms.googleapis.com
Aktifkan Gmail API
gcloud services enable gmail.googleapis.com
Aktifkan Groups Migration API
gcloud services enable groupsmigration.googleapis.com
Mengaktifkan Groups Settings API
gcloud services enable groupssettings.googleapis.com
Mengaktifkan Google Workspace Add-ons API
gcloud services enable gsuiteaddons.googleapis.com
Mengaktifkan Google Keep API
gcloud services enable keep.googleapis.com
Aktifkan Enterprise License Manager API
gcloud services enable licensing.googleapis.com
Mengaktifkan Marketplace API
gcloud services enable appsmarket.googleapis.com
Mengaktifkan Marketplace SDK
gcloud services enable appsmarket-component.googleapis.com
Aktifkan Meet REST API
gcloud services enable meet.googleapis.com
Aktifkan People API
gcloud services enable people.googleapis.com
Aktifkan Postmaster Tools API
gcloud services enable gmailpostmastertools.googleapis.com
Aktifkan Reseller API
gcloud services enable reseller.googleapis.com
Mengaktifkan Sheets API
gcloud services enable sheets.googleapis.com
Aktifkan Slides API
gcloud services enable slides.googleapis.com
Aktifkan Tasks API
gcloud services enable tasks.googleapis.com
Aktifkan Vault API
gcloud services enable vault.googleapis.com

Langkah berikutnya

Pelajari cara kerja autentikasi dan otorisasi untuk Google Workspace API.