Method: files.generateIds
संग्रह की मदद से व्यवस्थित रहें
अपनी प्राथमिकताओं के आधार पर, कॉन्टेंट को सेव करें और कैटगरी में बांटें.
यह फ़ाइल आईडी का एक सेट जनरेट करता है. इसे फ़ाइल बनाने या कॉपी करने के अनुरोधों में दिया जा सकता है. ज़्यादा जानकारी के लिए, फ़ाइलें बनाना और मैनेज करना लेख पढ़ें.
एचटीटीपी अनुरोध
GET https://www.googleapis.com/drive/v3/files/generateIds
यह यूआरएल, 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 License के तहत और कोड के नमूनों को Apache 2.0 License के तहत लाइसेंस मिला है. ज़्यादा जानकारी के लिए, Google Developers साइट नीतियां देखें. Oracle और/या इससे जुड़ी हुई कंपनियों का, Java एक रजिस्टर किया हुआ ट्रेडमार्क है.
आखिरी बार 2025-08-27 (UTC) को अपडेट किया गया.
[null,null,["आखिरी बार 2025-08-27 (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 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)."]]