'Google Drive API v3 Permissions sendNotificationEmail: False -Not Working
I am utilizing the Permissions endpoint call of the Google Drive API v3 to assign reader and writer status to a folder within app scripts for a shared google drive. The main goal is to not send the notification email when the permission is shared with a user. I have included the parameter 'sendNotificationEmail: false' in the body of the request however the email is still being sent notifying the user. The code snippet that I am using is below. Am I including the 'sendNotificationEmail' parameter in the wrong part of the request?
if (currTabName == "Testing" && curRange.getColumn() == 2){
for (var i = row; i < (row+rows); i++) {
var Email = currSS.getRange(i,2,1,1).getValue();
try{
var url = 'https://www.googleapis.com/drive/v3/files/FileID/permissions';
var data = {
'role': 'writer',
'type': 'user',
'sendNotificationEmail': false,
'emailAddress': Email,
'supportsAllDrives': true,
}
var options = {
'method' : 'POST',
'contentType': 'application/json',
'headers' : { Authorization: 'Bearer ' + 'yourAccessToken' },
'payload' : JSON.stringify(data) // Convert JavaScript object to JSON string
};
var response = UrlFetchApp.fetch(url, options);
Logger.log(response);
}
catch(err) {
Logger.log(err.message);
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
