הפעלת ממשקי API של Google Workspace

לפני שאתם משתמשים בממשקי Google API, אתם צריכים להפעיל אותם בפרויקט ב-Google Cloud. בכל פרויקט אפשר להפעיל ממשק API אחד או יותר. אם אין לכם פרויקט ב-Google Cloud, תוכלו לקרוא איך יוצרים פרויקט ב-Cloud.

כדי להפעיל API בפרויקט בענן:

מסוף Google Cloud

  1. במסוף Google Cloud, נכנסים לתפריט > APIs & Services > Library > Google Workspace.

    לדף API Library

  2. לוחצים על ה-API שרוצים להפעיל.
  3. לוחצים על הפעלה.
  4. כדי להפעיל ממשקי API נוספים, חוזרים על השלבים האלה.

Google Cloud CLI

  1. מתקינים או פותחים את ממשק שורת הפקודה (CLI) של Google Cloud.
  2. מריצים את הפקודה services enable ומציינים את שירות ה-API שרוצים להפעיל.

    gcloud services enable API_SERVICE_ID

ממשקי API שמופעלים מראש ב-Google AI Studio

כשאתם מפתחים אפליקציות אינטרנט ב-Google AI Studio, אתם לא צריכים להפעיל באופן ידני את ממשקי ה-API הנתמכים של Google Workspace במסוף Google Cloud. ממשקי ה-API הבאים מופעלים מראש בפרויקט בתוכנית למתחילים בניהול 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)

בפרויקט בתוכנית למתחילים, ממשקי ה-API של Google Workspace תומכים רק ב-OAuth 2.0 בצד הלקוח. לדוגמה, Google Picker API משתמש באסימוני גישה מסוג OAuth 2.0 במקום במפתח API למפתחים, ואין תמיכה בחשבונות שירות או באחסון של סודות לקוח של OAuth ב-Secret Manager. אם אתם צריכים פרטי כניסה בצד השרת, מפתחות API או ממשקי API נוספים כמו SDK לאדמינים או Google Apps Script API, אתם יכולים לשדרג את הפרויקט בתוכנית למתחילים לפרויקט רגיל ב-Cloud ולהגדיר אותם ידנית.

מידע נוסף על המכסות והתכונות של התוכנית למתחילים זמין במאמרים סקירה כללית על התוכנית למתחילים ופריסת אפליקציות אינטרנט מ-Google AI Studio.

(אופציונלי) התנסות בממשקי ה-API של Google Workspace באפליקציות ניסיוניות

אם אתם מתנסים ב-Google Workspace, אתם יכולים להשתמש בקיצור הדרך הבא, שמפעיל ממשקי API פופולריים של Google Workspace ויוצר פרטי כניסה ל-OAuth שבהם תוכלו להשתמש.

אם אתם מפתחים אפליקציה שניגשת למידע של משתמשים, אתם צריכים להגדיר את מסך ההסכמה של OAuth לפני שאתם משיקים את האפליקציה.

לוחצים על הכפתור הזה כדי לבחור או ליצור פרויקט בענן ב-Google, ולהפעיל באופן אוטומטי את ממשקי ה-API של Workspace:

הפעלת ממשקי ה-API של Workspace

בתיבת הדו-שיח שמופיעה, לוחצים על Download client configuration ושומרים את credentials.json בספריית העבודה.

ב-Google Workspace APIs Explorer תוכלו לראות רשימה מקיפה של כל ממשקי ה-API הזמינים, ולנסות שיטות ספציפיות מהדפדפן.

ממשקי API מופעלים (לחצו כדי להרחיב)

הכפתור מפעיל את ממשקי ה-API הבאים:

  • Admin SDK API
  • Apps Script API
  • Calendar API
  • Chat API
  • Classroom API
  • Docs API
  • Drive API
  • Forms API
  • ממשק ה-API של Gmail
  • Google Workspace Add-ons API
  • Google Keep API
  • ‫API בארכיטקטורת REST ב-Meet
  • Sheets API
  • Slides API

ממשקי API של Google Workspace

כדי להפעיל ממשקי Google Workspace API ספציפיים בפרויקט בענן, אתם יכולים להשתמש בקישורים הבאים למסוף Google Cloud או ב-Google Cloud Command Line Interface (CLI).

הפעלת 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
הפעלת Google Workspace Add-ons API
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 API בארכיטקטורת REST
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.