I have been having some issues with the google drive API and teamdrives. I can\'t for the life of me, figure out how to upload a file to team drive.
I\'m able to upload
You have put the supportsTeamDrives:"true"
in the wrong place.
the docs https://developers.google.com/drive/api/v2/reference/files/insert specify that it needs to be a query parameter.
So simply change your request query params to this:
'params': {'uploadType': 'multipart', supportsTeamDrives: 'true' }
So the whole request becomes:
var request = gapi.client.request({
'path': '/upload/drive/v2/files',
'method': 'POST',
'params': {'uploadType': 'multipart', 'supportsTeamDrives': 'true' },
'headers': {
'Content-Type': 'multipart/mixed; boundary="' + boundary + '"'
},
'body': multipartRequestBody
});