简体   繁体   English

调用Google People API时出现403错误

[英]403 error when calling Google People API

So I am trying call the Google People API with the following from the JS API: 因此,我尝试使用JS API中的以下代码调用Google People API:

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

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

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: 自从在我们的应用程序上启用API以来,已经有26个小时了,我们仍然从API收到此消息:

Google People API has not been used in project --project name here-- before or it is disabled. 之前,Google People API尚未在项目(此处为项目名称)中使用,或已被禁用。 Enable it by visiting https://console.developers.google.com/apis/api/people.googleapis.com/overview?project=--project name here-- then retry. 通过访问https://console.developers.google.com/apis/api/people.googleapis.com/overview?project=--此处的项目名称来启用它,然后重试。 If you enabled this API recently, wait a few minutes for the action to propagate to our systems and retry. 如果您最近启用了此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. 如果我打电话说要让授权用户的电子邮件获得正常运行的Gmail API,这似乎也只是这个API的问题。 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? 那么应该花这么长时间还是在这里我缺少什么?

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM