使用Bitbucket API获取用户所在的团队

时间:2013-05-15 15:46:04

标签: node.js bitbucket bitbucket-api

如何在用户所属的团队(组织)中获取JSON对象?

我正在documentationBitbucket REST API Console中搜索。

基本上我需要orgs.getFromUser function from Github API的通讯员,我在身份验证后传递用户名。

2 个答案:

答案 0 :(得分:2)

我认为你正在寻找this endpoint

您提供accountname并对其进行身份验证,并GET /1.0/groups/:accountname/。它将返回文档页面上显示的对象列表。

答案 1 :(得分:1)

使用API​​ 1.0的“用户端点”

https://confluence.atlassian.com/display/BITBUCKET/user+Endpoint

您要查找的电话是:https://bitbucket.org/api/1.0/user/privileges

您需要使用经过身份验证的用户调用此方法:

curl -u "USER_NAME:USER_PASSWORD" https://bitbucket.org/api/1.0/user/privileges

这将返回一个团队列表:

{u'teams': {u'team1': u'admin', u'team2': u'admin'}}