Using python, I can't access shared drive folders from Google Drive API v3
Notice that the API has the includeItemsFromAllDrives parameter in order to determine whether shared drive items show up or not in the results. The Python API V3 wrapper also has this parameter included on it's list method implementation that needs to be included when calling the list() method: ``` ... service = build('drive', 'v3', credentials [your value] # Call the Drive v3 API results = service.files().list( pageSize=10, includeItemsFromAllDrives=True, supportsAllDrives=T
Notice that the API has the includeItemsFromAllDrives parameter in order to determine whether shared drive items show up or not in the results. The Python API V3 wrapper also has this parameter included on it's list method implementation that needs to be included when calling the list() method: `` ... service = build('drive', 'v3', credentials [your value] # Call the Drive v3 API results = service.files().list( pageSize=10, includeItemsFromAllDrives=True, supportsAllDrives=True, fields="nextPageToken, files(id, name)").execute() items = results.get('files', []) ...
Context: Stack Overflow question (score 8, has accepted answer): I can get mydrive folders, but I can't access shared drive folders from Google Drive API. This is my code.(almost same to the Guides' code here) I followed the Guides, finished "Enable the Drive API", execute the pip command on VScode, and put credentials.json to the working directory. (I got no error, only got filename list of mydrive or 'No files found' that is printed by the code.) ``` from future import printfunction import pickle import os.path from googleapiclient.discovery import build from googleauth_oauthlib.flow import InstalledAppFlow from google.auth.transport.requests import Request # If modifying these scopes, delete the file token.pickle. SCOPES = ['https://www.googleapis.com/auth/drive.metadata.readonly'] def main(): """Shows basic usage of the Drive v3 API.
Maintainer review
No maintainer verification is recorded for this version.
This records the version a maintainer checked. It does not assert that the version is the latest upstream release.