Use la aplicación web de Google Script como Webhook para recibir notificaciones push directamente

Mi objetivo: cambios en Google Drive => Push Notification tohttps://script.google.com/a/macros/my-domain/... => La aplicación es presionada para tomar medidas. No quiero configurar un agente de Webhook intermedio para recibir notificaciones. En su lugar, deje que la aplicación web (por Google Script) lo reciba y lo envíe directamente.

Dado que la función relevante es bastante indocumentada (solo aquí:https://developers.google.com/drive/web/push), a continuación se muestra el código que probé pero falló. 1. ¿Es factible la idea anterior? 2. Parece que mi código doPost (R) no puede recibir la notificación (parámetro R) correctamente. De todos modos, no hay respuesta después de cambiar Google Drive. ¿Algún problema? (He intentado registrar el parámetro de entrada R para ver su estructura real y decidir si el parámetro Obj para OAuth es el mismo que la aplicación de Drive normal, pero se produce un error antes del registro)

function SetWatchByOnce(){
  var Channel = {
    'address': 'https://script.google.com/a/macros/my-domain/.../exec',
    'type': 'web_hook',
    'id': 'my-UUID'
  };

  var Result = Drive.Changes.watch(Channel); 
  ...
}    

function doPost(R) {
  var SysEmail = "My Email";
  MailApp.sendEmail(SysEmail, 'Testing ', 'Successfully to received Push Notification');

  var Response = JSON.parse(R.parameters);
  if (Response.kind == "drive#add") {
    var FileId = Response.fileId;
    MyFile = DriveApp.getFolderById(FileId);
    ...
  }
}


function doGet(e) {
  var HTMLToOutput;  
  var SysEmail = "My Email";

  if (e.parameters.kind) { 
      //I think this part is not needed, since Push Notification by Drive is via Post, not Get. I should use onPost() to receive it. Right?

    } else if (e.parameters.code) { 
      getAndStoreAccessToken(e.parameters.code);
      HTMLToOutput = '<html><h1>App is successfully installed.</h1></html>';

    } else { //we are starting from scratch or resetting
      HTMLToOutput = "<html><h1>Install this App now...!</h1><a href='" + getURLForAuthorization() + "'>click here to start</a></html>";
    }  

    return HtmlService.createHtmlOutput(HTMLToOutput);  
  }


....

Respuestas a la pregunta(2)

Su respuesta a la pregunta