Tag: google api

Google电子表格api请求的authentication范围不足

我正在使用nodejs上的以下脚本制作脚本以从Google电子表格中读取数据: var url = oauth2Client.generateAuthUrl({ access_type: 'offline', approval_prompt: 'force', scope: [ 'https://www.googleapis.com/auth/analytics.readonly', 'https://www.googleapis.com/auth/drive', 'https://www.googleapis.com/auth/spreadsheets' ] }); global.googleapis = { expiry_date: 0 }; google.options({ auth: oauth2Client }); var sheets = google.sheets('v4'); sheets.spreadsheets.get({ spreadsheetId: 'id'}, function(err, data) { res.send(err, data); }); 但在每一个请求我得到这个错误: Request had insufficient authentication scopes. 我查看了Google开发者控制台,启用了Google Drive API,并启用了它,所以我不知道它会是什么。

有Node.js的Google API库吗?

是否有一个Node.js库将Google的所有API都包含到一个API中? (Google通讯录,Google日历,Google地理定位API等)

Google Page Speed Insights – 基本authentication

我目前使用npm psi来对可公开访问的站点(基本authentication除外)进行psitesting。 我所有的尝试使用用户名:密码@约会迄今为止只有psi和psi的失败。 我想知道我是否错过了什么? { [Error: PageSpeed is currently unable to fetch this URL. Please try again later.] code: 400, noStack: true }

无法通过nodejs中的google api发送邮件

我正在尝试通过Google API发送电子邮件。 我在node.js中使用googleapis来访问Google API。 我的问题是,当我尝试发送没有附件的简单邮件时,出现以下错误: 'raw'RFC822负载消息string或通过/ upload / * URL上传消息 我没有在我的请求中定义有附件,我没有在电子邮件地址中看到任何错误。 请帮忙。 我的代码: var google = require('googleapis'); var gmailClass = google.gmail('v1'); var email_lines = []; email_lines.push("From: \"Some Name Here\" <rootyadaim@gmail.com>"); email_lines.push("To: hanochg@gmail.com"); email_lines.push('Content-type: text/html;charset=iso-8859-1'); email_lines.push('MIME-Version: 1.0'); email_lines.push("Subject: New future subject here"); email_lines.push(""); email_lines.push("And the body text goes here"); email_lines.push("<b>And the bold text goes here</b>"); var […]

使用nodejs进行Google身份validation

我正在尝试使用我的node.js服务器访问Google身份validationAPI,但我无法find。 基本上,我希望用户到达我的login页面,点击身份validationbutton,然后服务器将他redirect到Google API,用户允许我的应用程序访问他的数据,然后Google API将用户redirect到我的网站授权令牌。 我已经设置了oauth2所需的url,它似乎工作(如果我把它粘贴到我的网页浏览器,它会redirect到我的谷歌授权页面)。 我看到这个post似乎回答我的问题,但我不怎么处理快递代码部分。 这是我正在使用的代码: https.get(options, function(res) { var retrieved_data = ''; res.on('data', function(data) { retrieved_data += data; }); res.on('end', function() { // FIXME client_response.writeHead(302, {"Content-Type" : "text/plain", "Location" : res.headers.location}); client_response.end(retrieved_data); }); }); 但是这个方法在我的客户端页面上返回一个错误(由我的ajax请求的错误字段引发)。 如果我将HTTP代码更改为200,但没有“位置”信息,则会在客户端上显示一个“暂时移动”页面,其中包含一个将我redirect到Google API授权页面的button。 任何build议?