I'm trying to list all my google script files using the Google Drive File API as documented here. However I always get back an empty [] list. I think my token and my scopes are fine as I'm getting back this from Google OAuth2:
{ "access_token": "xxxxx", "expires_in": 3600, "refresh_token": "yyyyy",
"scope": "https://www.googleapis.com/auth/drive.scripts https://www.googleapis.com/auth/drive.appdata https://www.googleapis.com/auth/drive",
"token_type": "Bearer"
}
But then when I issue the query using mimeType filtering (I just want to get google app scripts list):
mimeType = 'application/vnd.google-apps.script'
I'm only getting back an empty items list ([]), even if I've just created a google script inside a Google Sheet:
{ "kind": "drive#fileList", "etag": "....", "selfLink": "https://www.googleapis.com/drive/v2/files?q=mimeType+%3D+'application/vnd.google-apps.script'", "incompleteSearch": false, "items": []}
I'm guessing that app-script means something else than google script code which is part of a Google Sheet... Any help appreciated :)
About retrieving the file list of projects of the container-bound script type and exporting each script from the project, please check the following answer.