Генерирует набор идентификаторов файлов, которые можно использовать в запросах на создание или копирование. Подробнее см. в разделе Создание и управление файлами .
HTTP-запрос
GET https://www.googleapis.com/drive/v3/files/generateIds
Пространство, в котором идентификаторы могут использоваться для создания файлов. Поддерживаемые значения: drive и appDataFolder . (По умолчанию: drive .) Подробнее см. в разделе Организация файлов .
type
string
Тип элементов, для которых можно использовать идентификаторы. Поддерживаемые значения: files и shortcuts . Обратите внимание, что shortcuts поддерживаются только в drivespace . (По умолчанию: 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
Некоторые области действия ограничены, и для их использования вашему приложению требуется оценка безопасности. Подробнее см. в руководстве по авторизации .
[[["Прост для понимания","easyToUnderstand","thumb-up"],["Помог мне решить мою проблему","solvedMyProblem","thumb-up"],["Другое","otherUp","thumb-up"]],[["Отсутствует нужная мне информация","missingTheInformationINeed","thumb-down"],["Слишком сложен/слишком много шагов","tooComplicatedTooManySteps","thumb-down"],["Устарел","outOfDate","thumb-down"],["Проблема с переводом текста","translationIssue","thumb-down"],["Проблемы образцов/кода","samplesCodeIssue","thumb-down"],["Другое","otherDown","thumb-down"]],["Последнее обновление: 2025-08-26 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)."]]