2

The use case is an embeddable editor using Google Drive as, well, a drive. I want to do this without users having to interact with drive.google.com. The embedder calls my API to create files, add permissions etc. All is fine and dandy except:

Drive.Builder(transport, jsonFactory, credential)
                                .build().files().get(fileId).execute();

returns null unless the file has been opened at least once via drive.google.com. It's the exact same piece of code getting exercised whether the file is opened with my app via drive.google.com or via my API. The credential is the same too.

Is this by design or am I missing something?

TheWhiteRabbit
  • 15,480
  • 4
  • 33
  • 57

1 Answers1

0

You are using the drive.file scope and perhaps both apps do not have access to that file. See the Google documentation for scopes.

Ali Afshar
  • 40,967
  • 12
  • 95
  • 109
  • Yes, you are right about the scope, thank you. But there's only one app, it's the same app doing the creating and the opening. I'm attempting what is stated as covered by the `drive.file` scope: "Per-file access to files created or opened by the app". The app tries to open files created by the app even though it's attempting to open them for users other than the creator. To cover my use case the definition needs to be "...created and opened..." as created is not sufficient. But, I'd rather see my use case included in the original definition, than a new definition ;) – Peter Svedberg Jan 31 '13 at 22:10