Back to Google Drive Programming Languages Index

Unicode C Google Drive REST API Examples

More Google Drive Examples at example-code.com.

List Files
Lists files..

About: get
Gets information about the user, the user's Drive, and system capabilities. This example will get the teamDriveThemes.

List Team Drives
Lists the user's Team Drives.

Create Team Drive
Creates a new Team Drive.

Delete a Team Drive
Delete a Team Drive. This example deletes the Team Drive having id = 0ANKf-53y-eUWUk9PVA.

Update a Team Drive's MetaData (Rename Team Drive)
Updates a Team Drive's metadata. This example sends a PATCH request to rename the team drive having id = 0ANGJSBRcgM0nUk9PVA.

Get Starting pageToken for Listing Future Changes
Gets the starting pageToken for listing future changes.

List Changes to a TeamDrive
Download a list of changes to a teamdrive. This example lists the changes for the team drive having id = "0AEd3EhGff2SaUk9PVA". The "pageToken" is obtained from a previous call to /drive/v3/changes/startPageToken or from the "nextPageToken" member of the previous call to list changes.

Create a New Comment on a File
Creates a new comment on a file. The file is specified by file ID. This example creates a comment on the file having id = "0B5drHSd5ZHwgc3RhcnRlcl9maWxlX2Rhc2hlclYw".

Creates a New Reply to a Comment
Creates a new reply to a comment. This example creates a reply to a comment on the file having fileId = "0B5drHSd5ZHwgc3RhcnRlcl9maWxlX2Rhc2hlclYw", and commentId = "AAAABg7tSGw".

List Comments on a File
Lists the comment on a file. The file is specified by file ID. This example lists comments on the file having id = "0B5drHSd5ZHwgc3RhcnRlcl9maWxlX2Rhc2hlclYw".

List Replies for a Specified Comment on a File
Lists the replies for a particular comment on a file. The file is specified by file ID. This example lists replies for comment (id="AAAABg7tSGw") on the file having id = "0B5drHSd5ZHwgc3RhcnRlcl9maWxlX2Rhc2hlclYw".

Delete a Reply from a Comment
Deletes a reply from a comment. This example deletes reply (id="AAAABg76H9o") from a comment (id="AAAABg7tSGw") on the file (id= "0B5drHSd5ZHwgc3RhcnRlcl9maWxlX2Rhc2hlclYw")

Update (Modify) a Reply on a Comment
Modifies a reply on a comment. This example modifies reply (id="AAAABg76H9g") on comment (id="AAAABg7tSGw") on the file (id= "0B5drHSd5ZHwgc3RhcnRlcl9maWxlX2Rhc2hlclYw")

Delete a Comment
Deletes a particular comment on a file. The file is specified by file ID. This example deletes the comment (id="AAAABg7vWfw") from the file having id = "0B5drHSd5ZHwgc3RhcnRlcl9maWxlX2Rhc2hlclYw".

Update a Comment
Updates (modifies) a particular comment on a file. This example updates the comment (id="AAAABg7tSGw") from the file having id = "0B5drHSd5ZHwgc3RhcnRlcl9maWxlX2Rhc2hlclYw".

List Files on a Team Drive
Retrieves a list of files for a particular team drive.

Make a Copy of a File
Makes a copy of a file. The name and description of the copy is provided in the JSON body of the request.

Delete a File
Permanently deletes a file owned by the user without moving it to the trash. If the file belongs to a Team Drive the user must be an organizer on the parent. If the target is a folder, all descendants owned by the user are also deleted.

Empty Trash
Permanently deletes all of the user's trashed files.

Export File to Requested MIME Type (Export to PDF)
Exports a Google Doc to the requested MIME type and returns the exported content. Please note that the exported content is limited to 10MB.
(Export only supports Google Docs) See
https://developers.google.com/drive/v3/web/manage-downloads for a list of MIME types.

About: Get Import and Export Formats
Gets information about Google Drive import formats and export formats.

Generate a Set of File IDs
Generates a set of file IDs which can be provided in create requests.

Get a File's MetaData
Gets a file's metadata by ID. (In this example the file id = 1R_70heIyzIAu1_u0prXbYcaIiJRVkgBl)

Download a File (Stream to the Filesystem)
Downloads the content of a file by ID. (In this example the file id = 1R_70heIyzIAu1_u0prXbYcaIiJRVkgBl) The file is streamed directly to the filesystem. Note: The alt=media query param must be used to download the file content (as opposed to the file metadata).

Rename a File (Update a File's MetaData)
Updates a file's metadata and/or content with patch semantics. (This example renames the file having id = 1R_70heIyzIAu1_u0prXbYcaIiJRVkgBl)

List a File's Permissions
List the permissions for a file by file id. (In this example the file id = 1R_70heIyzIAu1_u0prXbYcaIiJRVkgBl)

Create a Permission for a File
Creates a new permission for a file. (In this example the permission is created for the file with id = 1BXNQ4sMDD1WibOtcYqgQlwJa0MAa6rTQ)

Delete a Particular File Permission
Deletes the permission having an id = "anyoneWithLink". (In this example the file id = 1BXNQ4sMDD1WibOtcYqgQlwJa0MAa6rTQ)