谷歌联系人API无效的范围,但应用程序并不需要审核 - 联系人API

问题描述:

我尝试使用谷歌联系人API导入用户的Gmail联系人。这适用于我的Gmail,但是当其他人试图与以下错误消息登录失败:谷歌联系人API无效的范围,但应用程序并不需要审核 - 联系人API

Error: invalid_scope 

This app hasn't been verified to access: {invalid = [https://www.googleapis.com/auth/contacts]} Please contact the developer for assistance. Are you the developer? If this project needs these scopes, sign in to an account with access to edit your project and try again. If not, contact the developer for help. 

因为这个消息的,我做了一些研究,发现这question这表明该应用程序需要进行审查。然后我提交了我的应用程序verification。不过,我收到一封电子邮件,说我的应用不需要谷歌验证。

Thank you for submitting the developer verification form. Based on the information you provided, you have access to the scopes that you are planning to use. If you add any more scopes in the future, you may have to go through verification. 

我请求范围是https://www.google.com/m8/feeds/

此范围是否需要谷歌批准?

我使用GAPI库,下面是我的代码:

function start() { 
    var auth_obj = { 
    clientId: currentUser.GOOGLE_APP_ID, 
    scope: 'https://www.google.com/m8/feeds/' 
    } 
    gapi.client.init(auth_obj).then(function() { 
    gapi.auth2.getAuthInstance().isSignedIn.listen(updateSigninStatus); 
    updateSigninStatus(gapi.auth2.getAuthInstance().isSignedIn.get()); 
    }) 
}; 

gapi.load('client:auth2', start); 

function getContacts() { 

    var access_token = gapi.auth2.getAuthInstance().currentUser.get().getAuthResponse().access_token 
    var url = "https://www.google.com/m8/feeds/contacts/default/" 
    url += "thin?alt=json&access_token=" + access_token 
    url += "&max-results=500&v=3.0" 

    $.get(url) 
} 
+0

您正在使用哪个库?或者你只是在做手动HTTP请求?如果是后者,你有一些代码可以分享吗?此外,您的联系人API不需要批准即可使用。它只需要批准提高每天2000万个查询的默认限制。 –

+0

@ BlakeO'Hare更新了代码。我正在使用gapi库 – user2954587

+0

你可以检查auth令牌的值吗? (尽管这里不要粘贴它)。确保它以“ya29 ...”或类似的东西开头。错误是来自OAuth端点还是来自Contacts API端点? –

是的,如果你的程序是要通过随机其他用户使用,并且要求接触范围则需要进行审查和批准。

如果你指出,这是为自己使用或只有几个用户你从我们答案(它不需要审查)..原因。在这种情况下,您(以及需要批准的人)可以加入Google小组。您可能加入了Google小组,因此您可以批准此应用(或者您的帐户是gsuite的一部分)。

与我联系你的应用程序,我更多的细节可以看看具体情况。

+0

与您联系的最佳方式是什么?一个时间敏感的请求重定向uri的更新。谢谢! – user2954587

我建议你对评论进行回复,并非常清楚你打算什么样的数据访问,以及如何你要使用它。如果谷歌对您的数据意图有任何疑问,他们认为不太可能批准该请求。

另外,如果你打算只读他们的联系人,你可以修改的范围是https://www.googleapis.com/auth/contacts.readonly