Reference

Endpoint Update metadata in a file


Name

update_metadata_file

Description

Updates meta-data in a file [API reference]

Parameters

Parameter Required Options
Name: Id

Label: File Id

Id of a file you want to update meta-data to
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: keepRevisionForever

Label: Keep Revision Forever

Defines whether uploaded file has revisions
Option Value
True True
False False
Name: addParents

Label: AddParents

A comma-separated list of parent IDs to add
Name: ocrLanguage

Label: OcrLanguage

A language hint for OCR processing during image import (ISO 639-1 code).
Name: useContentAsIndexableText

Label: UseContentAsIndexableText

Whether to use the uploaded content as indexable text.
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
Id DT_WSTR nvarchar(440) 440
Kind DT_WSTR nvarchar(200) 200
Name DT_WSTR nvarchar(780) 780
MimeType DT_WSTR nvarchar(650) 650
DriveId 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
AppProperties DT_WSTR nvarchar(2000) 2000 A collection of arbitrary key-value pairs which are private to the requesting app. Entries with null values are cleared in update and copy requests. These properties can only be retrieved using an authenticated request. An authenticated request uses an access token obtained with a OAuth 2 client ID. You cannot use an API key to retrieve private properties.
ContentHintsIndexableText DT_WSTR nvarchar(2000) 2000 Text to be indexed for the file to improve fullText queries. This is limited to 128KB in length and may contain HTML elements.
ThumbnailImage DT_WSTR nvarchar(4000) 4000 The thumbnail data encoded with URL-safe Base64 (RFC 4648 section 5).
ThumbnailMimeType DT_WSTR nvarchar(4000) 4000 The MIME type of the thumbnail
ContentRestrictionsReadOnly DT_WSTR nvarchar(4000) 4000 Format: 'contentRestrictions[].readOnly'. Whether the content of the file is read-only. If a file is read-only, a new revision of the file may not be added, comments may not be added or modified, and the title of the file may not be modified.
ContentRestrictionsReason DT_WSTR nvarchar(4000) 4000 Format: 'contentRestrictions[].reason'. Reason for why the content of the file is restricted. This is only mutable on requests that also set readOnly=true.
CopyRequiresWriterPermission DT_BOOL bit Whether the options to copy, print, or download this file, should be disabled for readers and commenters
Description DT_WSTR nvarchar(4000) 4000 A short description of the file.
FolderColorRgb DT_WSTR nvarchar(2000) 2000 The color for a folder or shortcut to a folder as an RGB hex string. The supported colors are published in the folderColorPalette field of the About resource. If an unsupported color is specified, the closest color in the palette will be used instead.
MimeType DT_WSTR nvarchar(2000) 2000 The MIME type of the file. Google Drive will attempt to automatically detect an appropriate value from uploaded content if no value is provided. The value cannot be changed unless a new revision is uploaded. If a file is created with a Google Doc MIME type, the uploaded content will be imported if possible. The supported import formats are published in the About resource.
ModifiedTime DT_DBTIMESTAMP datetime Format: 2019-10-12T07:20:50.52Z. The last time the file was modified by anyone (RFC 3339 date-time). Note that setting modifiedTime will also update modifiedByMeTime for the user
Name DT_WSTR nvarchar(2000) 2000 The name of the file. This is not necessarily unique within a folder. Note that for immutable items such as the top level folders of shared drives, My Drive root folder, and Application Data folder the name is constant.
OriginalFilename DT_WSTR nvarchar(2000) 2000 The original filename of the uploaded content if available, or else the original value of the name field. This is only available for files with binary content in Google Drive.
Properties DT_WSTR nvarchar(2000) 2000 Entry as JSON object. A collection of arbitrary key-value pairs which are visible to all apps. Entries with null values are cleared in update and copy requests.
Starred DT_BOOL bit Whether the user has starred the file.
Trashed DT_BOOL bit Whether the file has been trashed, either explicitly or from a trashed parent folder. Only the owner may trash a file. The trashed item is excluded from all files.list responses returned for any user who does not own the file. However, all users with access to the file can see the trashed item metadata in an API response. All users with access can copy, download, export, and share the file.
ViewedByMeTime DT_DBTIMESTAMP datetime 2000 Format: 2019-10-12T07:20:50.52Z. The last time the file was viewed by the user (RFC 3339 date-time).
WritersCanShare DT_BOOL bit Whether users with only writer permission can modify the file's permissions. Not populated for items in shared drives.
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 / write Google Drive data inside your app; perform many Google Drive operations without coding, just using easy to use high performance API Connector for Google Drive
Google Drive
Update metadata in a file
Required Parameters
File Id Fill-in the parameter...
Optional Parameters
Keep Revision Forever
AddParents
OcrLanguage
UseContentAsIndexableText False
SSIS API Source - Read from table or endpoint

API Destination

API Destination - Google Drive
Read / write Google Drive data inside your app; perform many Google Drive operations without coding, just using easy to use high performance API Connector for Google Drive
Google Drive
Update metadata in a file
Required Parameters
File Id Fill-in the parameter...
Optional Parameters
Keep Revision Forever
AddParents
OcrLanguage
UseContentAsIndexableText False
SSIS API Destination - Access table or endpoint

ODBC application

Use these SQL queries in your ODBC application data source:

Update metadata in a file

-- We are out of SQL query examples for this Endpoint, sorry!
-- But will try to get some very very soon!

SQL Server

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

Update metadata in a file

DECLARE @MyQuery NVARCHAR(MAX) = '-- We are out of SQL query examples for this Endpoint, sorry!
-- But will try to get some very very soon!';

EXEC (@MyQuery) AT [LS_TO_GOOGLE_DRIVE_IN_GATEWAY];