谷歌电子表格创建-Node.js
我正在尝试使用node.js使用google电子表格api创建新的google电子表格 我已经设法让GoogleOAuth2.0工作,在那里我为客户端获取访问令牌 现在在搜索GoogleAPI文档时,有一个使用gData客户端库的示例,但没有给我指向node.js的指针 以下是我创建新的谷歌spreadhseet的发现谷歌电子表格创建-Node.js,node.js,google-sheets,google-spreadsheet-api,Node.js,Google Sheets,Google Spreadsheet Api,我正在尝试使用node.js使用google电子表格api创建新的google电子表格 我已经设法让GoogleOAuth2.0工作,在那里我为客户端获取访问令牌 现在在搜索GoogleAPI文档时,有一个使用gData客户端库的示例,但没有给我指向node.js的指针 以下是我创建新的谷歌spreadhseet的发现 手动或手动上载电子表格 使用可恢复的上传链接 关于可恢复上传链接的信息不多 我可以看到HTTP Post请求和响应,但我不知道如何在node.js中构造Post请求 编辑-- 我
我正在阅读如果您只想知道如何构造post请求,请检查此示例
如果您只想知道如何构造post请求,请查看此示例 结帐 EastCloud已经为Google Docs/Drive API编写了一个友好的ish包装
EastCloud已经围绕Google Docs/Drive API编写了一个友好的ish包装,下面介绍如何使用(目前为v4)的方法来实现它 此代码示例不使用任何第三方库,而是使用
下面是如何使用的方法(目前为v4) 此代码示例不使用任何第三方库,而是使用
如果您是新手,希望获取数据并将其添加到谷歌电子表格中,请参考下面的链接获取分步指南。
我在最近的nodejs项目中也进行了同样的测试如果您是新手,希望获取数据并将其添加到谷歌电子表格中,请参阅下面的链接以获取分步指南。
我在最近的nodejs项目中也接受了同样的测试我知道如何在node.js中执行post请求。我想知道我是否要向谷歌提出创建新电子表格的post请求,我应该做什么链接,我应该做什么post我知道如何在node.js中做post请求。我想知道我是否要向谷歌提出创建新电子表格的发帖请求,我应该发什么链接,我应该发什么
const google = require('googleapis');
const sheets = google.sheets('v4');
// authenticate, and store that authentication, in this example
// it is stored in a variable called `auth`. I am using JWT
// authentication, but you can use the any form of authentication
const auth = new google.auth.JWT(
key.client_email,
null,
key.private_key,
['https://www.googleapis.com/auth/spreadsheets'], // make sure that your auth scope includes `spreadsheets`, `drive` or `drive.file`
null
);
sheets.spreadsheets.create({
auth: auth,
resource: {
properties: {
title: 'Title of your new spreadsheet'
}
}
}, (err, response) => {
if (err) {
console.log(`The API returned an error: ${err}`);
return;
}
console.log('Created a new spreadsheet:')
console.log(response);
});