דוגמאות ל-API של Google Drive
קל לארגן דפים בעזרת אוספים
אפשר לשמור ולסווג תוכן על סמך ההעדפות שלך.
בקטע הזה מופיעות דוגמאות ל-Google Drive API.
סרטוני מבוא על Drive API זמינים ב ספריית הסרטונים של Drive API.
Google מארחת את הדוגמאות הבאות ב-GitHub. אתם יכולים ליצור עותק של המאגרים האלה ולהשתמש בקוד כהפניה לפרויקטים שלכם.
Google Picker
דוגמת הקוד של Google Picker מראה איך להשתמש בדף לבחירת תמונות או להעלאת תמונות, שמשתמשים יכולים לפתוח באמצעות כפתור באפליקציית אינטרנט.
כדי לראות או להוריד את המקור, אפשר להיכנס ל-Google Picker במאגר GitHub.
פתיחה ושמירה של קבצים באמצעות Quickeditors
בדוגמת הקוד הזו של Quickeditors מוצגות פעולות של פתיחה ושמירה של קבצים באמצעות Drive API.
כל אחת מהדוגמאות הספציפיות לפלטפורמת Drive משקפת אפליקציה לדוגמה: עורך טקסט בשם Quickeditor, שיכול לערוך קבצים ב-Drive עם סוג ה-MIME text/*
. בגרסת האינטרנט מיושמים שני תרחישי שימוש בסיסיים ב-Drive:
התהליך בשני תרחישי השימוש דומה. מערכת Drive מפנה משתמש לאפליקציה אחרי שהוא בוחר אותה מתוך תפריט היצירה או תפריט ההקשר של קובץ עם סוג MIME רשום.
כדי להציג או להוריד את המקור, אפשר להיכנס אל Drive
Quickeditors במאגר GitHub.
אלא אם צוין אחרת, התוכן של דף זה הוא ברישיון Creative Commons Attribution 4.0 ודוגמאות הקוד הן ברישיון Apache 2.0. לפרטים, ניתן לעיין במדיניות האתר Google Developers. Java הוא סימן מסחרי רשום של חברת Oracle ו/או של השותפים העצמאיים שלה.
עדכון אחרון: 2025-08-29 (שעון UTC).
[null,null,["עדכון אחרון: 2025-08-29 (שעון UTC)."],[],[],null,["# Google Drive API samples\n\nThis section provides samples for Google Drive API.\n\nFor introductory videos about Drive API, see the [Drive API\nvideo library](/workspace/drive/api/guides/videos).\n\nGoogle hosts the following samples on GitHub. You can fork these repositories\nand use the code as a reference for your own projects.\n\nGoogle Picker\n-------------\n\nThe [Google Picker code sample](/workspace/drive/picker/guides/sample) shows how to use\nan image selector or upload page that users can open from a button in a web app.\n\nTo view or download the source, visit\n[Google Picker](https://github.com/googleworkspace/browser-samples/tree/main/drive/picker)\non the GitHub repository.\n\nOpen and save files with Quickeditors\n-------------------------------------\n\nThis Quickeditors code sample shows how to open and save files with the\nDrive API.\n\nEach of the Drive platform-specific examples reflects a single\nsample app: a text editor, called a Quickeditor, capable of editing\nDrive files with the MIME type `text/*`. The [web\nversion](https://github.com/googleworkspace/drive-quickeditors/tree/main/web)\nimplements two fundamental Drive use cases:\n\n- [Integrate with Drive UI's \"New\" button](/workspace/drive/api/guides/integrate-create)\n- [Integrate with Drive UI's \"Open with\" context menu](/workspace/drive/api/guides/integrate-open)\n\nThe flow for both use cases is similar. Drive redirects a user to\nthe app after the user selects it from the create menu or the context menu of a\nfile with a registered [MIME type](/workspace/drive/api/guides/mime-types).\n\nTo view or download the source, visit [Drive\nQuickeditors](https://github.com/googledrive/web-quickeditor) on the GitHub\nrepository.\n\nRelated topics\n--------------\n\n- [The Google Picker API](/workspace/drive/picker/guides/overview)\n- [Drive UI integration overview](/workspace/drive/api/guides/about-apps)"]]