title: Google Drive - Changes:list API - Detect changes at folder level
body: <p>I'm testing out Google Drive 'Changes' API and have some questions.</p>
  
  <p>Expectation: 
  I've folder tree structure under 'My Drive' with files in them. I would like to call the Changes:list API to detect if items have been added/edited/deleted within that specific folder id.</p>
  
  <p>APIs Explorer tried: <a href="https://developers.google.com/drive/v2/reference/changes/list">https://developers.google.com/drive/v2/reference/changes/list</a> </p>
  
  <p>Questions:</p>
  
  <ol>
  <li><p>I don't see any option to pass a specific folder id to this API for getting the 'largestChangeId'. Looks like this api doesn't support the parm 'q'? Is it possible?</p></li>
  <li><p>As an alternate solution, thought of storing the 'modifiedDate' attribute for that folder and use it for comparing next time. But, it's not getting updated when items are updated within that folder. Should it not work like in windows where folder modified date gets updated when its contents gets updated?</p></li>
  </ol>
  
  <p>Would like to hear if it's possible to detect changes at folder level.</p>
  
  <p>Thanks</p>
  
  <p><strong>[EDIT]</strong></p>
  
  <p>Solution that worked:</p>
  
  <ol>
  <li><p>Use Files:list to list all.
  selected fields: items/id,items/modifiedDate,items/parents/id,items/title</p></li>
  <li><p>Get starting folder id ( e.g for 'MyRootFolder' using Title search)</p></li>
  <li>Traverse through the sub-tree structure (linking parents:id and file Id) using recursive array search and get max modifiedDate and total file counts.</li>
  <li>Store max modifiedDate and file counts in the app storage.</li>
  <li>For subsequent calls, compare the new max modifiedDate with the stored and also compare total file counts with the stored. If either one doesn't match, then contents within 'MyRootFolder' has been updated.</li>
  </ol>