I am trying to list all the files in my drive (about 10) but the following will only list 1 (and that isn't even a real file of mine)....
the code:
from httplib2 import Http
from oauth2client.client import SignedJwtAssertionCredentials
client='my_client_id'
client_email = 'my_client_email'
with open("/path/to/file.p12") as f:
private_key = f.read()
credentials = SignedJwtAssertionCredentials(client_email, private_key, 'https://www.googleapis.com/auth/drive')
http_auth = credentials.authorize(Http())
drive_service = build('drive', 'v2', http=http_auth)
r = drive_service.files().list().execute()
files = r['items']
for f in files:
print f['id'], f['title']
result:
"<file_id> How to get started with Drive"
EDIT: This question is similar but the answer is to have the correct oauth scope, which I have above.
EDIT #2: I thought it might be a timing issue so I gave it a few hours and still no goose.
EDIT #3: If I try to copy a file from another user then list my files then I'll get 2 files: " How to get started with Drive" " My New File" So, this is just listing files created by that app? How do I get the rest of my files???