调用Google People API时出现403错误 [英] 403 error when calling Google People API

查看:172
本文介绍了调用Google People API时出现403错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

因此,我尝试使用JS API中的以下代码调用Google People API:

So I am trying call the Google People API with the following from the JS API:

var request = gapi.client.people.people.get({
    'resourceName': 'people/me'
});

目的是检索用户电子邮件,以确保给定用户正在使用其公司Google帐户,而不是说其个人帐户用于与应用程序进行Google云端硬盘集成.

With the objective of retrieving the users email to ensure that a give user is using their corporate Google account and not say their personal account for a Google Drive integration with an application.

自从在我们的应用程序中启用API以来,大约有26个小时了,我们仍然从API收到此消息:

Its been about 26 hours now since the API was enabled on our application and we are still recieving this message back from the API:

在项目(此处为项目名称)中,尚未使用Google People API,否则该项目已被禁用.通过访问 https://console启用它此处的.developers.google.com/apis/api/people.googleapis.com/overview?project =-project 名称-然后重试.如果您最近启用了此API,请等待几分钟,以便该操作传播到我们的系统并重试.

Google People API has not been used in project --project name here-- before or it is disabled. Enable it by visiting https://console.developers.google.com/apis/api/people.googleapis.com/overview?project=--project name here-- then retry. If you enabled this API recently, wait a few minutes for the action to propagate to our systems and retry.

这似乎需要花费很长时间才能传播,其余的应用程序仍可以正常工作.如果我打电话说Gmail API可以使授权用户的电子邮件正常工作,那么似乎也只是这个API出现了问题.因此,我知道到目前为止的其余流程都可以正常工作.

This seems like this is taking an awful long time to propagate and the rest of the application works correctly. It also only seems to be this API that is the problem if I call say the Gmail API to get at the authorized users email that all works as expected. So I know the rest of the flow up to this point is working correctly.

当前在应用程序中使用的范围如下:

The scopes being used in the application right now are the following:

var scope = ['https://www.googleapis.com/auth/userinfo.email', 'https://www.googleapis.com/auth/userinfo.profile', 'https://www.googleapis.com/auth/drive', 'https://www.googleapis.com/auth/drive.file'];

那么应该花这么长时间还是在这里我缺少什么?

So should it be taking this long or is there something I am missing here?

推荐答案

转到https://console.developers.google.com/apis/api/people.googleapis.com/overview?project=xxxxxxxxx并启用 Google People API ,其中xxxxxxxxx是您的应用编号

Go and enable Google People API to https://console.developers.google.com/apis/api/people.googleapis.com/overview?project=xxxxxxxxx, where xxxxxxxxx is number of your app

这篇关于调用Google People API时出现403错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆