Reference

Endpoint Delete an item


Name

delete_item

Description

Deletes an item [API reference]

Related Tables

Files , Folders

Parameters

Parameter Required Options
Name: Id

Label: File Id

Id of an item you want to delete
YES
Name: DriveType

Label: Drive Type

Default search context is User's drive. Bodies of items (files/documents) to which the query applies. Supported bodies are 'user', 'domain', 'drive', and 'allDrives'. Prefer 'user' or 'drive' to 'allDrives' for efficiency. By default, corpora is set to 'user'. However, this can change depending on the filter set through the 'Query' parameter.
YES
Option Value
My Drive user
Shared Drive drive
Name: DriveId

Label: Shared DriveId

By default file lists from MyDrive but if you like to search other Shared drive (formally known as Team drive) then set this parameter.
Name: SupportsAllDrives

Label: Supports all drives (e.g. My and Shared)

Whether the requesting application supports both My Drives and shared drives.
Option Value
true true
false false

Output Columns

Label Data Type (SSIS) Data Type (SQL) Length Description
Status DT_WSTR nvarchar(4000) 4000
If the column you are looking for is missing, consider customizing Google Drive Connector.

Input Columns

Label Data Type (SSIS) Data Type (SQL) Length Description
Id DT_WSTR nvarchar(4000) 4000
Required columns that you need to supply are bolded.

Examples

SSIS

Use Google Drive Connector in API Source or in API Destination SSIS Data Flow components to read or write data.

API Source

API Source - Google Drive
Read and write Google Drive data effortlessly. Integrate, manage, and automate files, folders, and shared drives — almost no coding required.
Google Drive
Delete an item
There are no parameters to configure.
SSIS API Source - Read from table or endpoint

API Destination

This Endpoint belongs to the Files table, therefore it is better to use it, instead of accessing the endpoint directly. Use this table and table-operation pair to delete an item:

API Destination - Google Drive
Read and write Google Drive data effortlessly. Integrate, manage, and automate files, folders, and shared drives — almost no coding required.
Google Drive
Files
Delete
There are no parameters to configure.
SSIS API Destination - Access table operation

ODBC application

Use these SQL queries in your ODBC application data source:

Delete a file

<p>Deletes a file by ID. Supply the file ID in the WITH clause.</p>

DELETE FROM Files
WITH(Id='1gcu0hV34OTfgvcu9CFhr7Go4b35j5Mop')

Delete a file by name from a shared drive

<p>Deletes a file by name from a shared drive. Supply the file name in the WHERE clause and the shared drive ID in WITH. Use <code>Trashed=0</code> to target only non-trashed files.</p>

DELETE FROM Files
WHERE Name='dump.csv' AND Trashed=0
WITH(DriveId='0AC00HWQH144cUk9PVA', DriveType='drive')

Delete a folder

<p>Deletes a folder by ID. Supply the folder ID in the WITH clause.</p>

DELETE FROM Folders
WITH(Id='1yDO11prsLH9DUrBTCadV6GGMJrITjF9I')

delete_item endpoint belongs to Files , Folders table(s), and can therefore be used via those table(s).

SQL Server

Use these SQL queries in SQL Server after you create a data source in Data Gateway:

Delete a file

<p>Deletes a file by ID. Supply the file ID in the WITH clause.</p>

DECLARE @MyQuery NVARCHAR(MAX) = 'DELETE FROM Files
WITH(Id=''1gcu0hV34OTfgvcu9CFhr7Go4b35j5Mop'')';

EXEC (@MyQuery) AT [LS_TO_GOOGLE_DRIVE_IN_GATEWAY];

Delete a file by name from a shared drive

<p>Deletes a file by name from a shared drive. Supply the file name in the WHERE clause and the shared drive ID in WITH. Use <code>Trashed=0</code> to target only non-trashed files.</p>

DECLARE @MyQuery NVARCHAR(MAX) = 'DELETE FROM Files
WHERE Name=''dump.csv'' AND Trashed=0
WITH(DriveId=''0AC00HWQH144cUk9PVA'', DriveType=''drive'')';

EXEC (@MyQuery) AT [LS_TO_GOOGLE_DRIVE_IN_GATEWAY];

Delete a folder

<p>Deletes a folder by ID. Supply the folder ID in the WITH clause.</p>

DECLARE @MyQuery NVARCHAR(MAX) = 'DELETE FROM Folders
WITH(Id=''1yDO11prsLH9DUrBTCadV6GGMJrITjF9I'')';

EXEC (@MyQuery) AT [LS_TO_GOOGLE_DRIVE_IN_GATEWAY];

delete_item endpoint belongs to Files , Folders table(s), and can therefore be used via those table(s).