I have a test endpoint running and when I drop a file into the watched folder I get a request with the header X-Goog-Resource-State: update
, but I don't seem to get an Id for the added file.
X-Goog-Resource-Id
which I'd thought might be the new file, but I get a 404 if I try to get()
itX-Goog-Resource-Uri
, but that belongs to the watched folderX-Goog-Channel-Id
, but that clearly belongs to the channel not the fileX-Request-Id
, but that's just an opaque UUIDAm I required to fetch a complete list of files for the watched folder on every update and compare to a saved list? That doesn't feel right, but I'm at a loss.
Any guidance would be much appreciated.
Is there any better way of doing this today? After searching the Drive API Docs it doesn't appear that it has changed.
I'll throw another idea out there if it has not changed. What I will probably end up doing is creating 2 folders, one for New Items and one for Processed Items. I'll watch the New Items folder and when notified, I'll process any files in the folder and move them to the Processed Items folder. Just personal preference on this one but I'd prefer not to change the files' properties or modify them in any way and I'd be a little paranoid that if I get them by time created I'd either process some files more than once or somehow one would get left out here or there.
It would be great to be able to receive notifications of added files including their IDs though!
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