Method: files.generateIds
تنظيم صفحاتك في مجموعات
يمكنك حفظ المحتوى وتصنيفه حسب إعداداتك المفضّلة.
تنشئ هذه الطريقة مجموعة من أرقام تعريف الملفات التي يمكن تقديمها في طلبات الإنشاء أو النسخ. لمزيد من المعلومات، يُرجى الاطّلاع على إنشاء الملفات وإدارتها.
طلب HTTP
GET https://www.googleapis.com/drive/v3/files/generateIds
يستخدِم عنوان URL بنية تحويل الترميز gRPC.
مَعلمات طلب البحث
المعلمات |
count |
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/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-08-27 (حسب التوقيت العالمي المتفَّق عليه)
[null,null,["تاريخ التعديل الأخير: 2025-08-27 (حسب التوقيت العالمي المتفَّق عليه)"],[],[],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 create or copy requests.\n\n### HTTP request\n\n`GET https://www.googleapis.com/drive/v3/files/generateIds`\n\nThe URL uses [gRPC Transcoding](https://google.aip.dev/127) syntax.\n\n### Query parameters\n\n| Parameters ||\n|---------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `count` | `integer` The 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 file IDs which can be provided in create 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` Identifies what kind of resource this is. Value: the fixed string `\"drive#generatedIds\"`. |\n\n### Authorization scopes\n\nRequires one of the following OAuth scopes:\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)."]]