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:
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
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.
How would I know which file was deleted?
EDIT: I've created a video showing my problems, steps
https://www.youtube.com/watch?v=hh2ARFdxWGk
Sorry for the poor quality, I used a bad screen recording tool
You might try using the Apps Activity API instead of Changes. I just tested with Apps Activity API and both trash and emptyTrash show as events. The API Explorer gives you an idea of how to achieve this.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With