问题描述
我正在使用OAuth2进行身份验证.使用访问令牌,我可以通过Get成功访问日历列表,通过Post成功访问Calendar Events,并通过帖子创建Calendar Event.每次尝试获取联系人列表都会失败,并显示"403禁止".
I am authenticating using OAuth2. Using an access token I can successfully access Calendar Lists via a Get, Calendar Events via a Post, and create a Calendar Event via a post. Every attempt to do a Get to get a Contact List fails with a 403 Forbidden.
我已通过以下范围进行了身份验证scope = openid%20email%20https://www.googleapis.com/auth/calendar%20https://www.google.com/m8/feeds/
I authenticated with the following scopescope=openid%20email%20https://www.googleapis.com/auth/calendar%20https://www.google.com/m8/feeds/
在登录期间,请参阅对列出的联系人的访问.
And during the login, see access to contacts listed.
我的获取URL为 https://www.google. com/m8/feeds/contacts/default/full?v = 3.0
无论是否使用v = 3.0,我都尝试过使用它,并且使用我的电子邮件地址代替默认地址.
I have tried it with and without the v=3.0, and with my email address in place of default.
在Google Developers控制台上,我启用了Calendar API和Contact API.
On the Google Developers console, I have Calendar API and Contact API enabled.
我现在可以通过不推荐使用的V2 .net api访问联系人,但是使用REST for V3不会连接.不幸的是,与Calendar API不同,Google页面底部没有测试程序"来发送OAuth2请求以检索联系人列表.
I had no trouble accessing the Contacts via the now deprecated V2 .net api, but using REST for V3 it just will not connect. Unfortunately, unlike the Calendar API, there is no "tester" at the bottom of the Google page to send an OAuth2 request to retrieve a list of contacts.
有人有这个功能吗?还是我在这里缺少一些简单的东西?
Has anyone gotten this to work, or is there something simple I am missing here?
推荐答案
根据您的请求 https://www.google.com/m8/feeds/contacts/default/full 通过& key = {{< your__access_token }}.这应该可以解决您的问题.
With Your request https://www.google.com/m8/feeds/contacts/default/fullpass &key={{your__access_token}}.This should solve your problem.
这篇关于禁止使用Google Contact API V3 403的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!