Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to add push notification for a particular folder in google drive to get all updates that happen for all the file inside the folder

I want to set a push notification for a folder in google drive using google api such that any changed made to any file inside that folder than i get a call -back.

like image 240
Divyesh Avatar asked Apr 06 '15 14:04

Divyesh


People also ask

Can Google Drive notify changes in folder?

Turn on notifications In Chrome Browser, open Drive. and select Settings. On the left, click Notifications and choose an option: To receive updates on your web browser, check the Get updates about Google Drive items in your browser box, and select the items you want to be notified about.

Does Google Drive update files automatically?

On your computerThey'll automatically update to Drive on the web.

Where do Google Drive notifications go?

To help manage your tasks, Google is adding a notifications tab inside the Drive app for Android that allows you to view activity on every file you have stored in the cloud. The new notifications menu can be found inside the Drive app for all Google accounts — though we should note, it isn't live for everyone yet.

Is there a way to be notified when a Google doc is updated?

In Google DocsYou won't get notifications when you make changes on your doc, but you'll get notifications when anyone adds or removes content.


1 Answers

What I know is that its not possible at this moment. Instead of that you can create changes hook and get informed if ANY file on drive is changed. After theat run file search request to find all files within given folder by passing its ID, ie:

"'<folder_id>' in parents"

where <folder_id> is id of the folder where you want to look for changes. You can then look for last modified date and compare to your own cache, for example stored on your server in cache files. If file is newer than do with it whatever you want (and of course update cache).

please refer to: https://developers.google.com/drive/v2/reference/changes/watch https://developers.google.com/drive/web/search-parameters

like image 121
mkatanski Avatar answered Oct 19 '22 13:10

mkatanski