Method: files.export
מייצאת מסמך Google Workspace לסוג ה-MIME המבוקש ומחזירה תוכן בבייט שיוצא. חשוב לזכור שהתוכן שמיוצא מוגבל ל-10MB.
בקשת HTTP
GET https://www.googleapis.com/drive/v3/files/{fileId}/export
בכתובת ה-URL נעשה שימוש בתחביר המרת קידוד של gRPC.
פרמטרים של נתיב
פרמטרים |
fileId |
string
המזהה של הקובץ.
|
פרמטרים של שאילתה
פרמטרים |
mimeType |
string
חובה. סוג ה-MIME של הפורמט המבוקש לייצוא הזה.
|
גוף הבקשה
גוף הבקשה חייב להיות ריק.
גוף התשובה
אם הפעולה בוצעה ללא שגיאות, השיטה הזו מחזירה את תוכן הקובץ כבייטים. רשימה של מסמכי Google Workspace ופורמטים של המרות מסוג MIME זמינה במאמר מסמכי Google Workspace וסוגי MIME מתאימים.
היקפי ההרשאות
נדרש אחד מהיקפי ההרשאות הבאים של OAuth:
https://www.googleapis.com/auth/drive
https://www.googleapis.com/auth/drive.file
https://www.googleapis.com/auth/drive.meet.readonly
https://www.googleapis.com/auth/drive.readonly
חלק מההיקפים מוגבלים וצריך לבצע בדיקת אבטחה כדי להשתמש בהם באפליקציה. מידע נוסף זמין במדריך להרשאות.
אלא אם צוין אחרת, התוכן של דף זה הוא ברישיון Creative Commons Attribution 4.0 ודוגמאות הקוד הן ברישיון Apache 2.0. לפרטים, ניתן לעיין במדיניות האתר Google Developers. Java הוא סימן מסחרי רשום של חברת Oracle ו/או של השותפים העצמאיים שלה.
עדכון אחרון: 2024-09-04 (שעון UTC).
[null,null,["עדכון אחרון: 2024-09-04 (שעון UTC)."],[[["Exports a Google Workspace document to the requested MIME type, returning the file content as bytes with a 10MB size limit."],["Requires providing the file ID as a path parameter and the desired MIME type as a query parameter in the GET request."],["The request body should be empty, and successful responses contain the exported file content in the specified format."],["Authorization is necessary using one of the specified OAuth scopes, some of which may require a security assessment."]]],["This describes exporting Google Workspace documents via a `GET` request to `https://www.googleapis.com/drive/v3/files/{fileId}/export`. The `fileId` is a required path parameter, and `mimeType` is a required query parameter specifying the desired export format. The request body must be empty. A successful response returns the file content as bytes, limited to 10MB. Authorization requires specific OAuth scopes, including `drive`, `drive.file`, `drive.meet.readonly`, or `drive.readonly`.\n"]]