Tag: google api

Vue项目和googleapis – 不会生成 – child_process错误

目标 在vue-cli项目中安装并构buildgoogleapis包。 例 https://github.com/ChaddPortwine/test-googleapis 为了创build这个例子,我简单地: vue init webpack test-googleapis npm install npm install googleapis –save , npm install google-auth-library –save npm run dev (到目前为止,没关系,应用程序build立和运行) 添加行, import googleapis from 'googleapis'到main.js npm run dev (ERR Child_Process ) 错误 ERROR Failed to compile with 13 errors 11:16:12 AM These dependencies were not found: * child_process in ./node_modules/googleapis/node_modules/google-auth-library/lib/auth/googleauth.js * […]

使用google-api-javascript-client和node.js

Google的客户端JS库为其API: https : //code.google.com/p/google-api-javascript-client/wiki/GettingStarted 我想知道是否有任何方法可以使用node.js (我在写一个使用google日历api的小应用程序,我对node.js非常陌生)

我如何通过NodeJs在谷歌云中设置数据存储区索引configuration?

我试图在我的数据存储上运行GQL查询。 像这样的东西: SELECT * FROM products WHERE model = @model AND date >= @date 但有这样的错误: You need an index to execute this query. 在谷歌API文档中,我没有发现关于nodejs的索引。 我如何设置这个索引?

Google API NodeJS Library OAuth2请求

我正在尝试设置Google API使用授权,以便向网站站长工具API发出请求,但似乎无法理解如何触发身份validation。 我build立了一个路由,它应该在访问时触发authentication权限调用,但是我得到一个连续的负载信号,没有收到数据响应。 我正在使用Google的图书馆https://github.com/google/google-api-nodejs-client/ ,并将我的OAuth2客户端ID凭据redirect到指向http://localhost:3000/ uri,因为我想testing本地安装。 这是我的代码: index.js var express = require('express'); var app = express(); var handlebars = require('hbs'); var google = require('googleapis'); var webmastertools = google.webmasters('v3'); app.set('port', process.env.PORT || 3000); // Handlebars View Engine app.set('view engine', handlebars); app.use(express.static(__dirname + '/public')); // set the public directory app.listen(app.get('port'), function(){ console.log('Server on port'+app.get('port')); }); var routes […]

谷歌API日历手表不起作用,但渠道创build

我试着听我的日历更改事件( 谷歌应用程序/日历/ V3 /参考/事件/手表 )。 我做了一切从谷歌控制台端,域 – 好吧,一切都validation,我成功地创build频道。 此外,我成功地获得sync消息与正确的标题(见下文)。 从文档: 同步消息 创build新的通知频道以观看资源后,Google日历API会发送同步消息以指示通知正在启动。 这些消息的X-Goog-Resource-State HTTP标头值是同步的。 由于networking时间问题,即使在收到监视方法响应之前,也可能会收到同步消息。 这意味着notifications are starting 但是,当我改变了一些在snaggs@comp.com帐户 – 什么也没有发生,没有请求发送到callback : 'https://dev-api.mycompany/google-watch/' 这是我的工作代码: var google = require('googleapis'); var googleAuth = require('google-auth-library'); var _ = require('underscore-node'); var uuid = require('node-uuid'); // …… var channel_id = uuid.v1(); _auth.credentials = { access_token: _token.access_token, token_type: _token.token_type, refresh_token: _token.refresh_token, […]

Google OAuth2 API刷新令牌

我正在使用google-auth-library-nodejs库集成到一些GMail帐户中,以获取电子邮件列表。 我的stream程很简单: 1)尝试使用此function授权客户端: function _authorise(mailBox, callback) { let auth = new googleAuth(); let clientId = eval(`process.env.GMAIL_API_CLIENT_ID_${mailBox.toUpperCase()}`); let clientSecret = eval(`process.env.GMAIL_API_CLIENT_SECRET_${mailBox.toUpperCase()}`); let redirectUri = eval(`process.env.GMAIL_API_REDIRECT_URI_${mailBox.toUpperCase()}`); let tokenFile = process.env.GMAIL_API_TOKEN_PATH + mailBox.toLowerCase()+ process.env.GMAIL_API_TOKEN_BASE_FILE_NAME; let oauth2Client = new auth.OAuth2(clientId, clientSecret, redirectUri); fs.readFile(tokenFile, ((err, token) => { if (err) { _getNewToken(mailBox,oauth2Client,callback); } else { oauth2Client.credentials = JSON.parse(token); callback(oauth2Client); } […]

如何在使用服务帐户上传时修复Google云端硬盘的存储空间不足问题

如果您使用的是Google Apps for Work(也称为G-Suite),并通过云端硬盘API将file upload到Google云端硬盘,那么您最终会看到一条如下所示的错误消息: Error: The user's Drive storage quota has been exceeded. 阅读下面了解为什么发生这种情况,以及如何解决这个问题

Google网站pipe理员NodeJs API了解响应

我试图了解当我尝试使用Google Webmasters API运行查询时收到的响应。 我没有得到一个错误,因为console.log返回null ,但是我收到了Not Found res参数,这使得它似乎有什么closures与传递给查询方法的params对象。 当我看着网站pipe理员的github文件 ,似乎我正确的顺序通过正确的领域,但一定要closures。 任何人都可以提供一些关于如何进一步debugging的指导,或者我的对象键值对清楚地说明了什么地方。 这是我的控制台: This is the error: null This is the response: Not Found 这里是这个问题的代码: /** * Lists the search query results * * @param {google.auth.OAuth2} auth An authorized OAuth2 client. */ function keywordQuery(auth) { console.log("This is the auth token" + auth); var webmasters = google.webmasters('v3'); var […]

无需访问令牌即可调用API

我实现了Google+和Facebookloginbutton,并成功获取访问令牌。 但是我没有保存在我的服务器。 对于新业务,我需要获得授权用户的显示名称和图像。 对于Facebook的整合,我可以使用: https://graph.facebook.com/userId?fields=picture.width(720).height(720),name&access_token=APP_ID|APP_SECRET 有没有类似的方式让Google+ API在没有缺less访问令牌的情况下获取Google+用户的公开信息(图片,姓名,电子邮件等)?

从NodeJS(或云function)获取GCE实例的临时IP

我遇到麻烦findNodeJS API访问任一: 当前分配的临时IP和相关实例名称的列表,或者 一个实例的短暂的IP,如果我已经知道它的名字。 我正在运行一个云端函数,它需要能够检查一组给定的基本实例名称的临时IP地址是否发生变化。 请注意,实例是由实例组创build的。 我没有问题获取有关在我的函数中插入/删除的实例的信息,但我找不到任何方式来检索与实例关联的外部IP。