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?
You are using the
drive.filescope and perhaps both apps do not have access to that file. See the Google documentation for scopes.