簡體   English   中英

谷歌電子表格 API v4 編輯器訪問

[英]Google spreadsheet API v4 editor access

我想知道是否有任何方法可以通過 NODEJS 中的 API 將一些 email 作為編輯器添加到谷歌電子表格中。

您可以使用驅動器 API 來共享訪問權限。

   import { google } from 'googleapis';
   
   const drive = google.drive({ version: 'v3', auth: yourAuthClient });

   drive.permissions.create({
        fileId: yourSpreadsheetId,
        resource: {
            type: 'user',
            role: 'writer',
            emailAddress: 'example@abc.com',
        },
    });

查看此官方文檔了解更多詳細信息https://developers.google.com/drive/api/guides/manage-sharing

如果您是 googleapis 的新手,我發現這篇文章很有幫助。 https://bretcameron.medium.com/how-to-use-the-google-drive-api-with-javascript-57a6cc9e5262

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM