如何将我的值附加到Google电子表格OAUTH / GAPI js

问题描述

我想创建chrome扩展程序,以使用oauth和Google Apis(gapi)在google表格中添加文本; 你能给我看看代码示例吗?我在background.js中有这段代码


function onGAPILoad() {
  gapi.client.init({
 
    apiKey: API_KEY,discoveryDocs: disCOVERY_DOCS,}).then(function () {
    console.log('gapi initialized')
    chrome.identity.getAuthToken({interactive: true},function(token) {
      gapi.auth.setToken({
        'access_token': token,});
      gapi.client.sheets.spreadsheets.values.get({
        spreadsheetId: SPREADSHEET_ID,range: 'Sheet1',}).then(function(response) {
        console.log(response)
      

      });
    })
    

  },function(error) {
    console.log('error',error)
  })
}


解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)