Google Workspace API चालू करें

Google API का इस्तेमाल करने से पहले, आपको उन्हें Google Cloud प्रोजेक्ट में चालू करना होगा. एक Google क्लाउड प्रोजेक्ट में, एक या इससे ज़्यादा एपीआई चालू किए जा सकते हैं. अगर आपके पास पहले से कोई Google Cloud प्रोजेक्ट नहीं है, तो क्लाउड प्रोजेक्ट बनाएं देखें.

अपने Cloud प्रोजेक्ट में किसी एपीआई को चालू करने के लिए:

Google Cloud कंसोल

  1. Google Cloud Console में, मेन्यू > एपीआई और सेवाएं > लाइब्रेरी > Google Workspace पर जाएं.

    एपीआई लाइब्रेरी पर जाएं

  2. उस एपीआई पर क्लिक करें जिसे आपको चालू करना है.
  3. चालू करें पर क्लिक करें.
  4. ज़्यादा एपीआई चालू करने के लिए, यह तरीका दोहराएं.

Google Cloud सीएलआई

  1. Google Cloud कमांड लाइन इंटरफ़ेस (सीएलआई) इंस्टॉल करें या खोलें.
  2. services enable कमांड चलाएं और बताएं कि आपको किस एपीआई सेवा को चालू करना है.

    gcloud services enable API_SERVICE_ID

Google AI Studio में पहले से चालू एपीआई

Google AI Studio में वेब ऐप्लिकेशन बनाते समय, आपको Google Cloud Console में जाकर, Google Workspace के साथ काम करने वाले एपीआई को मैन्युअल तरीके से चालू करने की ज़रूरत नहीं पड़ती. 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)

स्टार्टर टियर प्रोजेक्ट में, Google Workspace के एपीआई सिर्फ़ क्लाइंट-साइड OAuth 2.0 के साथ काम करते हैं. उदाहरण के लिए, Google Picker API, डेवलपर एपीआई पासकोड के बजाय OAuth 2.0 ऐक्सेस टोकन का इस्तेमाल करता है. साथ ही, सेवा खातों या Secret Manager में OAuth क्लाइंट सीक्रेट को सेव करने की सुविधा काम नहीं करती. अगर आपको सर्वर-साइड क्रेडेंशियल, एपीआई पासकोड या Admin SDK API या Google Apps Script API जैसे अतिरिक्त एपीआई की ज़रूरत है, तो स्टार्टर टियर प्रोजेक्ट को स्टैंडर्ड क्लाउड प्रोजेक्ट में अपग्रेड करें और उन्हें मैन्युअल तरीके से कॉन्फ़िगर करें.

स्टार्टर टियर के कोटा और सुविधाओं के बारे में जानने के लिए, स्टार्टर टियर के बारे में खास जानकारी और Google AI Studio से वेब ऐप्लिकेशन डिप्लॉय करना लेख पढ़ें.

(ज़रूरी नहीं) प्रयोग के तौर पर लॉन्च किए गए ऐप्लिकेशन में, Google Workspace के एपीआई आज़माना

अगर आपको Google Workspace को आज़माना है, तो इस शॉर्टकट का इस्तेमाल करें. इससे Google Workspace के लोकप्रिय एपीआई चालू हो जाते हैं और OAuth क्रेडेंशियल बन जाते हैं. इनका इस्तेमाल किया जा सकता है.

अगर आपको ऐसा ऐप्लिकेशन बनाना है जो उपयोगकर्ता की जानकारी को ऐक्सेस करता है, तो आपको अपना ऐप्लिकेशन रिलीज़ करने से पहले, OAuth की सहमति वाली स्क्रीन को कॉन्फ़िगर करना होगा.

कोई Google Cloud प्रोजेक्ट चुनने या बनाने के लिए, इस बटन पर क्लिक करें. इससे Workspace के एपीआई अपने-आप चालू हो जाएंगे:

Workspace API चालू करना

इसके बाद दिखने वाले डायलॉग बॉक्स में, क्लाइंट कॉन्फ़िगरेशन डाउनलोड करें पर क्लिक करें और credentials.json को अपनी वर्किंग डायरेक्ट्री में सेव करें.

उपलब्ध सभी एपीआई की पूरी सूची देखने और अपने ब्राउज़र से खास तरीके आज़माने के लिए, Google Workspace APIs explorer देखें.

चालू किए गए एपीआई (बड़ा करने के लिए क्लिक करें)

इस बटन से ये एपीआई चालू होते हैं:

  • Admin SDK API
  • Apps Script API
  • Calendar API
  • Chat API
  • Classroom API
  • Docs API
  • डिस्क API
  • Forms API
  • Gmail API
  • Google Workspace Add-ons API
  • Google Keep API
  • Meet REST API
  • Sheets API
  • Slides API

Google Workspace APIs

अपने Cloud प्रोजेक्ट में Google Workspace के कुछ एपीआई चालू करने के लिए, Google Cloud console के इन लिंक या Google 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
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 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 के एपीआई के लिए, पुष्टि करने और अनुमति देने का तरीका जानें.