获得使用谷歌加API的用户圈子列表 [英] Get list of circles of a user using Google Plus API

查看:180
本文介绍了获得使用谷歌加API的用户圈子列表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用谷歌aouth在以下范围

I am using google aouth with following in scope

scope : ['https://www.googleapis.com/auth/tasks', 'https://www.googleapis.com/auth/tasks.readonly', 'https://www.googleapis.com/auth/userinfo.profile', 'https://www.googleapis.com/auth/plus.me', 'https://www.googleapis.com/auth/plus.circles.read']

我试图获取有关用户信息,我用下面的API

I tried to get information about user, I've used following API

var xhr = Ti.Network.createHTTPClient({
            onload : function() {
                var data = this.responseText;
                var json = JSON.parse(data);
                Ti.API.log('json: ' + JSON.stringify(json));
            }
        });
        xhr.open("GET", "https://www.googleapis.com/oauth2/v1/userinfo?alt=json&access_token=" + googleAuth.getAccessToken());
        xhr.send();

但它只提供了有关用户的基本信息资料,我怎样才能得到关于圈内的用户朋友们的信息。

but it only gives information about users basic info, how can I get information about users friends in circle.

我换成 xhr.open(GET,https://www.googleapis.com/oauth2/v1/userinfo?alt=json&access_token=+ googleAuth.getAccessToken()) ;

xhr.open("GET", "https://www.googleapis.com/plusDomains/v1/people/me/circles?access_token=" + googleAuth.getAccessToken());

在控制台中的反响文本就像

the responce text in console was like

json: {"error":{"errors":[{"domain":"global","reason":"forbidden","message":"Forbidden"}],"code":403,"message":"Forbidden"}}

我已启用


  • Google+的API,

  • 的Blogger API,

  • Google+页面API,

  • Google+的API域,

推荐答案

最接近此,该API具有是的 People.list

The closest thing to this that the API has is People.list

https://www.googleapis.com/plus/v1/people/me/people/connected?key={YOUR_API_KEY}

尝试测试集,看看哪一个适合您的需要了。你可以在页面底部测试结果。有没有办法让圈又回到的名称。

Try testing the collection see which one suits your needs more. You can test the results at the bottom of the page. There is no way to get the name of the circle back.

可接受的值是:

连接
  圈谁也使用要求的应用程式。这个清单被限制为用户
  谁做他们的可见的应用程序活动,以验证用户。

"connected": The list of visible people in the authenticated user's circles who also use the requesting app. This list is limited to users who made their app activities visible to the authenticated user.

可见:谁该用户已添加到一个或一个以上的人名单
  圈,仅限于圈子可见的请求的应用程序。

"visible": The list of people who this user has added to one or more circles, limited to the circles visible to the requesting application.

这篇关于获得使用谷歌加API的用户圈子列表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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