Changes are afoot with the Drive API.....

24 views
Skip to first unread message

dimud...@gmail.com

unread,
May 2, 2019, 8:14:57 PM5/2/19
to Google Apps Script Community
Lot's to digest here. The impending updates covered in the latest GSuite announcement is bound to impact apps that leverage the Drive API. See link below:

https://cloud.google.com/blog/products/application-development/upcoming-changes-to-the-google-drive-api-and-google-picker-api

Faustino Rodriguez

unread,
May 3, 2019, 7:33:51 AM5/3/19
to Google Apps Script Community
Indeed, not a dull moment
I just started to migrate some projects from DriveApp to Drive.Files, so I will need to understand if I'd be affected

I am using the following code in GAS to fetch the content of a file (Text/Json content)
They don't mention the downloadUrl, but not sure if I understand the whole change yet

function getFileContent(fileId, mimeType) {
 
return UrlFetchApp.fetch( Drive.Files.get(fileId).downloadUrl, {
   
'contentType': mimeType,
   
'headers': {
     
'Authorization': 'Bearer ' + ScriptApp.getOAuthToken()
   
}
 
}).getContentText();
}

Would that be OK, or there is a better/new way?
Reply all
Reply to author
Forward
0 new messages