title: How to get starred files using the Google Drive Api and a service account?
body: <p>I am developing an app locally which will eventually run on Google App Engine in Go.</p>
  <p>I'm using a service account key as suggested in the cloud docs:</p>
  <blockquote>
  <p><a href="https://cloud.google.com/docs/authentication" rel="nofollow noreferrer">https://cloud.google.com/docs/authentication</a></p>
  <p>Accessing private data on behalf of a service account outside Google
  Cloud environments</p>
  <p>Recommendation: Service account key</p>
  </blockquote>
  <p>This is the intended workflow:</p>
  <ol>
  <li>The admin creates a Drive folder which is shared with select users and the service account.</li>
  <li>The users can create files in that shared folder.</li>
  <li>The admin can star a selection of those files and invoke the app.</li>
  <li>The app queries for starred files in that shared folder and processes those files.</li>
  </ol>
  <p>Now if the admin uses the Files: list &quot;Try this API&quot; at:</p>
  <p><a href="https://developers.google.com/drive/api/v3/reference/files/list" rel="nofollow noreferrer">https://developers.google.com/drive/api/v3/reference/files/list</a></p>
  <p>with the this query string:</p>
  <pre><code>parents in 're89w...r9d9' and starred
  </code></pre>
  <p>then the starred files show up.</p>
  <p>However when my app uses the same string:</p>
  <pre><code>q := &quot;parents in '&quot; + folderID + &quot;' and starred &quot;
  fl, err = srvDrive.Files.List().PageSize(100).Q(q).Fields(&quot;nextPageToken, files(name)&quot;).Do()
  </code></pre>
  <p>then fl is an empty list; there are no starred files.</p>
  <p>I suspect it has something to do with using a service account and there may be a way to fix this by impersonating something in some way, but the docs get deep and I'm not sure it will even help if I figure it out.</p>
  <p>How does my app query for starred files in the admin's drive?</p>