Files: generateIds

Generates a set of file IDs which can be provided in create or copy requests. Try it now.

Request

HTTP request

GET https://www.googleapis.com/drive/v3/files/generateIds

Parameters

Parameter name Value Description
Optional query parameters
count integer The number of IDs to return. Acceptable values are 1 to 1000, inclusive. (Default: 10)
fields string The paths of the fields you want included in the response. If not specified, the response includes a default set of fields specific to this method. For development you can use the special value * to return all fields, but you'll achieve greater performance by only selecting the fields you need. For more information, see Return specific fields for a file.
space string The space in which the IDs can be used to create new files. Supported values are 'drive' and 'appDataFolder'. (Default: 'drive')
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')

Authorization

This request requires authorization with at least one of the following scopes:

Scope
https://www.googleapis.com/auth/drive
https://www.googleapis.com/auth/drive.file
https://www.googleapis.com/auth/drive.appdata

Some scopes are restricted and require a security assessment for your app to use them. For more information, see the authentication and authorization page.

Request body

Do not supply a request body with this method.

Response

If successful, this method returns a response body with the following structure:

{
  "kind": "drive#generatedIds",
  "space": string,
  "ids": [
    string
  ]
}
Property name Value Description Notes
kind string Identifies what kind of resource this is. Value: the fixed string "drive#generatedIds".
space string The type of file that can be created with these IDs.
ids[] list The IDs generated for the requesting user in the specified space.

Try it!

Use the APIs Explorer below to call this method on live data and see the response.