Google Drive API - Changes: list. Getting the original ID of a deleted file

Asked
Active3 hr before
Viewed126 times

6 Answers

drivegoogle
90%

Stack Overflow for Teams Where developers & technologists share private knowledge with coworkers ,The Changes: list shows my first file ID and right after that the second created file ID. It doesn't show to delete file event,The first thing is that the entries in the changes feed are ordered in ascending chronological order. That is, the oldest changes show up first. So check the last enries in the response. ,None of the identifiers (fileId and id) equal the id from the file 'This is a test file'. I read in the API documentation that the results are from the bottom up, but non of the deleted changes contain my original file id.

Make new testfile : This is a test file

public 'title' => string 'This is a test'(length = 14)
public 'id' => string '1wUFHe3DfU1mJnyqlIgAYSvMrIy8F91-7rZyAPFsyVpg'(length = 44)
load more v
88%

When trying to detect deleted objects using the Changes: list feed, I noticed that the id value is incorrect making it impossible for me to detect which file was deleted. Example:,I show the file ID in the Changes: list,Now when I delete this file the first entry for a deleted change is:,I show it's ID in the Changes: list

Make new testfile : This is a test file

public 'title' => string 'This is a test'(length = 14)
public 'id' => string '1wUFHe3DfU1mJnyqlIgAYSvMrIy8F91-7rZyAPFsyVpg'(length = 44)
load more v
72%

None of the identifiers (fileId and id) equal the id from the file 'This is a test file'. I read in the API documentation that the results are from the bottom up, but non of the deleted changes contain my original file id.,After spending few hours and reading more carefully the documentation, I've finally found the problem. ,Now when I delete this file the first entry for a deleted change is:,The Changes: list shows my first file ID and right after that the second created file ID. It doesn't show to delete file event

Make new testfile : This is a test file

public 'title' => string 'This is a test'(length = 14)
public 'id' => string '1wUFHe3DfU1mJnyqlIgAYSvMrIy8F91-7rZyAPFsyVpg'(length = 44)

Now when I delete this file the first entry for a deleted change is:

public 'deleted' => boolean true
protected 'fileType' => string 'Google_Service_Drive_DriveFile'(length = 30)
protected 'fileDataType' => string ''(length = 0)
public 'fileId' => string '1_8Cvirw71AY0HQoaNwSMP3TlcIFAhpZikVfOrXFZCLo'(length = 44)
public 'id' => string '3612'(length = 4)
public 'kind' => string 'drive#change'(length = 12)
public 'modificationDate' => string '2013-12-23T10:55:45.340Z'(length = 24)
public 'selfLink' => string 'https://www.googleapis.com/drive/v2/changes/3612'(length = 48)
protected 'modelData' =>
   array(size = 0)
empty
protected 'processed' =>
   array(size = 0)
empty
load more v
65%

Folder (list): Option to select folder to insert file in.,Select “-- Use Folder ID --” for the Folder option.,Here’s how to set up a new configuration in Google Drive:,This event trigger will fire when a new file is created inside of GoogleDrive or added to GoogleDrive.

load more v
75%

The initial setup for drive involves getting a token from Google drive which you need to do in your browser. rclone config walks you through it.,You can set the root_folder_id for rclone. This is the directory (identified by its Folder ID) that rclone considers to be the root of your drive.,This takes an optional directory to trash which make this easier to use via the API.,Provide the noted client ID and client secret to rclone.

Here is an example of how to make a remote called remote. First run:

 rclone config
load more v
40%

googledrive is “pipe-friendly” and, in fact, re-exports %>%, but does not require its use.,Hold on to all the other metadata sent back by the API,Track what the API wants: the file ID,The metadata for one or more Drive files is held in a dribble, a “Drive tibble”. This is a data frame with one row per file. A dribble is returned (and accepted) by almost every function in googledrive. Design goals: Give humans what they want: the file name Track what the API wants: the file ID Hold on to all the other metadata sent back by the API

install.packages("googledrive")
load more v

Other "drive-google" queries related to "Google Drive API - Changes: list. Getting the original ID of a deleted file"