Method: files.generateIds
קל לארגן דפים בעזרת אוספים
אפשר לשמור ולסווג תוכן על סמך ההעדפות שלך.
יצירת קבוצה של מזהי קבצים שאפשר לספק בבקשות להוספה או להעתקה.
בקשת HTTP
GET https://www.googleapis.com/drive/v2/files/generateIds
כתובת ה-URL משתמשת בתחביר של Transcoding של gRPC.
פרמטרים של שאילתה
פרמטרים |
maxResults |
integer
המספר המקסימלי של מזהי חשבון שיוחזרו.
|
space |
string
המרחב שבו אפשר להשתמש במזהים כדי ליצור קבצים חדשים. הערכים הנתמכים הם drive ו-appDataFolder . (ברירת המחדל: drive )
|
type |
string
סוג הפריטים שבהם אפשר להשתמש במזהים. הערכים הנתמכים הם files ו-shortcuts . הערה: התמיכה ב-shortcuts קיימת רק ב-drive space . (ברירת המחדל: files )
|
גוף הבקשה
גוף הבקשה חייב להיות ריק.
גוף התשובה
רשימה של מזהים שנוצרו שאפשר לספק בבקשות להוספה
אם הפעולה מצליחה, גוף התגובה מכיל נתונים במבנה הבא:
ייצוג ב-JSON |
{
"ids": [
string
],
"space": string,
"kind": string
} |
שדות |
ids[] |
string
המזהים שנוצרו למשתמש המבקש במרחב המשותף שצוין.
|
space |
string
סוג הקובץ שאפשר ליצור באמצעות המזהים האלה.
|
kind |
string
הערך הזה תמיד הוא drive#generatedIds
|
היקפי הרשאה
נדרש אחד מהיקפי ההרשאות הבאים של OAuth:
https://www.googleapis.com/auth/docs
https://www.googleapis.com/auth/drive
https://www.googleapis.com/auth/drive.appdata
https://www.googleapis.com/auth/drive.file
היקפי הרשאה מסוימים מוגבלים, ונדרש הערכת אבטחה כדי שהאפליקציה שלכם תוכל להשתמש בהם. מידע נוסף זמין במדריך ההרשאות.
אלא אם צוין אחרת, התוכן של דף זה הוא ברישיון Creative Commons Attribution 4.0 ודוגמאות הקוד הן ברישיון Apache 2.0. לפרטים, ניתן לעיין במדיניות האתר Google Developers. Java הוא סימן מסחרי רשום של חברת Oracle ו/או של השותפים העצמאיים שלה.
עדכון אחרון: 2025-07-25 (שעון UTC).
[null,null,["עדכון אחרון: 2025-07-25 (שעון UTC)."],[],[],null,["# Method: files.generateIds\n\n- [HTTP request](#body.HTTP_TEMPLATE)\n- [Query parameters](#body.QUERY_PARAMETERS)\n- [Request body](#body.request_body)\n- [Response body](#body.response_body)\n - [JSON representation](#body.GeneratedIds.SCHEMA_REPRESENTATION)\n- [Authorization scopes](#body.aspect)\n- [Try it!](#try-it)\n\nGenerates a set of file IDs which can be provided in insert or copy requests.\n\n### HTTP request\n\n`GET https://www.googleapis.com/drive/v2/files/generateIds`\n\nThe URL uses [gRPC Transcoding](https://google.aip.dev/127) syntax.\n\n### Query parameters\n\n| Parameters ||\n|--------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `maxResults` | `integer` Maximum number of IDs to return. |\n| `space` | `string` The space in which the IDs can be used to create new files. Supported values are `drive` and `appDataFolder`. (Default: `drive`) |\n| `type` | `string` The type of items which the IDs can be used for. Supported values are `files` and `shortcuts`. Note that `shortcuts` are only supported in the `drive` `space`. (Default: `files`) |\n\n### Request body\n\nThe request body must be empty.\n\n### Response body\n\nA list of generated IDs which can be provided in insert requests\n\nIf successful, the response body contains data with the following structure:\n\n| JSON representation |\n|----------------------------------------------------------------|\n| ``` { \"ids\": [ string ], \"space\": string, \"kind\": string } ``` |\n\n| Fields ||\n|---------|----------------------------------------------------------------------------|\n| `ids[]` | `string` The IDs generated for the requesting user in the specified space. |\n| `space` | `string` The type of file that can be created with these IDs. |\n| `kind` | `string` This is always `drive#generatedIds` |\n\n### Authorization scopes\n\nRequires one of the following OAuth scopes:\n\n- `https://www.googleapis.com/auth/docs`\n- `\n https://www.googleapis.com/auth/drive`\n- `\n https://www.googleapis.com/auth/drive.appdata`\n- `\n https://www.googleapis.com/auth/drive.file`\n\nSome scopes are restricted and require a security assessment for your app to use them. For more information, see the [Authorization guide](/workspace/guides/configure-oauth-consent)."]]