问题标签 [google-api-nodejs-client]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
1 回答
658 浏览

google-app-engine - 将 Google APIs Node.js 客户端库与 AppEngine Cloud Endpoints 一起使用?

我编写了一个使用 Cloud Endpoints 的 Java App Engine 应用程序。我想从 Node.js 应用程序与这些端点交谈。是否可以为此目的使用 google-api-nodejs-client ?

我已经尝试过这个:

但是库没有发现我的端点,回调返回 nullerr并且client看起来像这样:

我已经用“myapiname”替换了我的真实 api 名称,当然 URLhttp://localhost:8888/_ah/api/discovery/v1/apis/是可访问的(如果我在同一台计算机上的浏览器中打开它,它会返回正确的发现 JSON)。

0 投票
1 回答
243 浏览

node.js - 不允许请求的范围:admin.directory.group.member

我想提出插入授权请求。根据API Explorer我需要以下范围:

在代码中它看起来像这样:

我有一个pem用于 JWT 身份验证的文件。让我们看一下代码:

我收到以下错误:

为什么我会收到此错误?

0 投票
2 回答
1618 浏览

node.js - 缺少必填字段:成员

运行以下请求时出现此错误:

我已成功通过身份验证(我收到了访问令牌等),但是当我执行上面的请求时,它会回调该错误。

member我应该添加什么字段?

它在API Explorer中使用groupKeyemail字段运行良好。

0 投票
1 回答
3491 浏览

node.js - NodeJS Google Api client: how do I know the access token is expired?

I am working on Nodejs Google Api client Oauth process. I follow what the code example for oauth, https://github.com/google/google-api-nodejs-client/blob/master/examples/oauth2.js.

I have one question. How do I check if the access token is expired and how do I use the refresh token to get another access token again?

To be more specific, let's say get access to google+ user profile, so I use the access token to get user profile:

In addition, in the client side of the application(backbonejs), if I am attempting to use google api JS client to access the google drive api (not google plus), I am not sure if I can use the access token I get from server side of the application (nodejs) or I have to do another OAuth using google api JS client.

0 投票
2 回答
1820 浏览

node.js - 基本文件下载示例

我一直在努力阅读 google-apis 的 nodejs 文档。我收集了很长的示例列表,但其中任何一个都可以帮助我做我想做的事情。我只想使用节点 js 从我的驱动器下载一个文件。

我已经设置了 OAUTH 并使用此代码获得了访问令牌(来源: http://masashi-k.blogspot.com.es/2013/07/accessing-to-my-google-drive-from-nodejs 。 html )

但我不知道如何从这里继续。我尝试过这样的事情,但没有运气:

我觉得我很接近,但我需要一些帮助。

提前致谢。

0 投票
1 回答
466 浏览

node.js - 我如何通过 NodeJs 在谷歌云中设置数据存储索引配置?

我正在尝试在我的数据存储上运行 GQL 查询。像这样的东西:

但是有如下错误:

在 google api 文档中,我没有发现任何关于 nodejs 的索引。我如何设置这个索引?

0 投票
1 回答
2276 浏览

node.js - NodeJS JWT Sign.sign TypeError: Not a buffer

I am currently working on a node.js app which should create events in google calendar. On my machine (OS X 10.9.2) it works well, but on another machine (Debian 7 Wheezy 64-bit) it does not work. Both have installed the same node.js version: v0.10.26. I always get the following error:

The code that causes this error:

SERVICE_ACCOUNT_KEY_FILE is the path to my .pem keyfile, which also can be found by the application.

Everything works locally, but not on the Debian machine. Do I have to install some dependencies or something similar?

EDIT1: I also tried passing the key as a string via the third argument, but that didn't work either.

Thank you!

0 投票
1 回答
586 浏览

node.js - 谷歌 JSON API 和 GQL。按日期范围获取对象

我尝试通过 GQL 和 JSON API 按日期范围在谷歌数据存储中查找对象。例如,这是我的要求:

但我得到错误:

我可以编辑此请求或使用其他方式按日期范围获取对象吗?

0 投票
2 回答
674 浏览

express - 检索用户的 Google+ 活动列表

我需要在 Google+ 中获取用户的活动列表。我的编码平台是 node.js Express 框架,我使用的是 google-api-nodejs-client 包。

我得到了我的个人资料详细信息。但是活动正在返回值:null。我检查了我的 Google+ 页面以确保我有公开的帖子。另外,我自己也向“公众”分享了一些帖子。请帮我找到我的代码中的错误。

编辑

实际上,有一个错误。我按照 Ryan Seys 的建议通过在控制台中记录 err 对象的值来找到它。

错误--------------->

0 投票
1 回答
199 浏览

google-glass - 使用 google api nodejs 客户端更新或修补 Glass 时间轴中的现有卡片

我正在使用 Google 的官方 js 客户端来访问 Google API,在本例中是 Google Glass Mirror API。

我需要一些有关如何使用update甚至更好的patch方法的指导(请参阅https://developers.google.com/glass/v1/reference/timeline)来更新我之前插入到时间线中的时间线卡。

插入和列出相当容易并且可以成功运行。我已经使用本教程开始:https ://github.com/emil10001/glass-mirror-nodejs-auth-demo/blob/master/app.js

我试过以下:

我得到以下有效负载的成功响应:

我最终得到的是内容为空的卡片。我怀疑我没有正确使用更新方法并且第二个参数resource没有正确命名?