0

My scenario is that I want to look for a file, that if it exists, was created by my app.

If I request drive scope, I can use

/drive/v2/files?q=trashed%3Dfalse+and+title+%3D+'MyFile'+and+'root'+in+parents

and all is good.

But this requires access to all the users existing drive files, which is too demanding. So I removed the drive scope and try the same command with only drive.file scope.

In return I get

{
  "code" : 500,
  "errors" : [ {
    "domain" : "global",
    "message" : "Internal Error",
    "reason" : "internalError"
  } ],
  "message" : "Internal Error"
}

Hacking around, if I remove the 'root' in parents, I get

{
 "kind": "drive#fileList",
 "etag": "\"Q5ElJByAJoL0etObruYVPRipH1k/vyGp6PvFo4RvsFtPoIWeCReyIC8\"",
 "selfLink": "https://www.googleapis.com/drive/v2/files?q=trashed%3Dfalse+and+title+%3D+'MyFile'",
 "items": []
}

which is better than a 500, but still not what I expected.

So how can I check if MyFile exists without requiring drive scope?

pinoyyid
  • 21,499
  • 14
  • 64
  • 115

1 Answers1

0

This is a known bug we're fixing soon.

GET https://www.googleapis.com/drive/v2/files/children?q=title+contains+'My title'

will also only list files from root that your application has right to access.

Burcu Dogan
  • 9,153
  • 4
  • 34
  • 34
  • That works, thx Burcu. Having leapt that hurdle, I've now hit another scope issue at http://stackoverflow.com/questions/18246001/what-scope-is-required-to-read-an-uploaded-file :-( – pinoyyid Aug 15 '13 at 03:44