user エンドポイント

お困りですか?

アトラシアン コミュニティをご利用ください。

コミュニティに質問

Bitbucket Cloud v1 API は廃止予定です

Bitbucket Cloud REST API バージョン 1 は 2018 年 6 月 30 日に廃止予定です。すべての 1.0 API は、2019 年 4 月 12 日に、REST API から完全に削除されます。廃止についての告知をご確認ください。また、バージョン 2.0 の REST API ドキュメントをご確認ください。

概要

Use the /user endpoints to gets information related to the currently authenticated Bitbucket Cloud user. It is useful for OAuth or other in situations where the username is unknown. This endpoint returns information about an individual or team account. Individual and team accounts both have the same set of user fields:

フィールド 説明
username アカウントに関連付けられたユーザー名。
first_name アカウントに関連付けられた名前。
last_name アカウントに関連付けられた名字。チーム アカウントの場合、この値は常に空になります。
avatar アカウントに関連付けられたアバター。
resource_uri アカウントのリソース ID。
 

チームおよびユーザー アカウントは、0 個またはそれ以上のリポジトリを持ちます。リポジトリ リソースのコンテンツの情報については、repositories エンドポイント 1.0 をご参照ください。

ユーザー プロファイルの取得

1 つのアカウントに関連付けられた基本情報と、そのユーザーが所有するすべてのリポジトリの一覧を返します。

GET https://api.bitbucket.org/1.0/user
クリックしてレスポンスを展開...
個人とチーム アカウントで同じ構造のレスポンスが返されます。


{
    "repositories": [
        {
            "scm": "git",
            "has_wiki": false,
            "last_updated": "2012-06-27 00:22:15",
            "creator": null,
            "created_on": "2012-06-27 00:22:15",
            "owner": "1team",
            "logo": null,
            "email_mailinglist": "",
            "is_mq": false,
            "size": 580,
            "read_only": false,
            "fork_of": null,
            "mq_of": null,
            "followers_count": 1,
            "state": "available",
            "utc_created_on": "2012-06-26 22:22:15+00:00",
            "website": "",
            "description": "",
            "has_issues": false,
            "is_fork": false,
            "slug": "justdirectteam",
            "is_private": true,
            "name": "justdirectteam",
            "language": "",
            "utc_last_updated": "2012-06-26 22:22:15+00:00",
            "email_writers": true,
            "no_public_forks": false,
            "resource_uri": "/1.0/repositories/1team/justdirectteam"
        }
    ],
    "user": {
        "username": "1team",
        "first_name": "1 Team",
        "last_name": "",
        "is_team": true,
        "avatar": "https://secure.gravatar.com/avatar/24b6be68b53e383c5d42bab4fe
0bde2b?d=https%3A%2F%2Fdwz7u9t8u8usb.cloudfront.net%2Fm%2Fcc0a0a43301e%2Fimg%2Ft
eam_no_avatar_32.png&s=32",
        "resource_uri": "/1.0/users/1team"
    }
}

ユーザーの更新

Updates the basic information associated with an account. It operates on the currently authenticated user. Specify one or more fields with the exception of the username field. This call ignores changes to the username field. Omitted fields retain their existing values. The call returns the user structure.

PUT https://api.bitbucket.org/1.0/user --data "field=value&field=value&..." 

クリックしてレスポンスを展開...

個人とチーム アカウントで同じ構造のレスポンスが返されます。

 {
        "username": "auserbb",
        "first_name": "foo",
        "last_name": "User",
        "is_team": false,
        "avatar": "https://secure.gravatar.com/avatar/49bd0ee69e520e8bc250adb95710bbb8?d=identicon&s=32",
        "resource_uri": "/1.0/users/auserbb"
}

ユーザー権限の一覧の取得

Gets the account-level privileges for an individual or team account. Use this call to locate the accounts that the currently authenticated  accountname has access to. An account can have admin or collaborator (member) privileges. The accountname always has admin privileges on itself. 

GET   https://api.bitbucket.org/1.0/user/privileges
個人アカウントの場合のレスポンス。クリックして展開...
{
    "teams": {
        "auserbb": "admin"
	"1team": "collaborator"
	"2team": "admin"
    }
}

1 つのアカウントがフォローしているリポジトリ一覧の取得

個人またはチーム アカウントがフォローしているリポジトリの詳細を取得します。この呼び出しはリポジトリの完全なデータを返します。これには、対象のリポジトリが他のリポジトリのフォークであるかどうかが含まれます。アカウントは常に自身のリポジトリをフォローします。 

GET https://api.bitbucket.org/1.0/user/follows
クリックしてレスポンスを展開...

In the example below, auser-justdirectteam is a fork of the team justdirectteam repository.

 [
    {
        "scm": "git",
        "has_wiki": false,
        "last_updated": "2012-06-27 00:22:15",
        "creator": null,
        "created_on": "2012-06-27 00:22:15",
        "owner": "1team",
        "logo": null,
        "email_mailinglist": "",
        "is_mq": false,
        "size": 580,
        "read_only": false,
        "fork_of": null,
        "mq_of": null,
        "followers_count": 2,
        "state": "available",
        "utc_created_on": "2012-06-26 22:22:15+00:00",
        "website": "",
        "description": "",
        "has_issues": false,
        "is_fork": false,
        "slug": "justdirectteam",
        "is_private": true,
        "name": "justdirectteam",
        "language": "",
        "utc_last_updated": "2012-06-26 22:22:15+00:00",
        "email_writers": true,
        "no_public_forks": false,
        "resource_uri": "/1.0/repositories/1team/justdirectteam"
    },
    {
        "scm": "hg",
        "has_wiki": false,
        "last_updated": "2012-07-12 01:50:25",
        "creator": null,
        "created_on": "2012-07-12 01:50:25",
        "owner": "auserbb",
        "logo": null,
        "email_mailinglist": "",
        "is_mq": false,
        "size": 541,
        "read_only": false,
        "fork_of": null,
        "mq_of": null,
        "followers_count": 1,
        "state": "available",
        "utc_created_on": "2012-07-11 23:50:25+00:00",
        "website": "",
        "description": "",
        "has_issues": false,
        "is_fork": false,
        "slug": "myowncode",
        "is_private": true,
        "name": "myowncode",
        "language": "",
        "utc_last_updated": "2012-07-11 23:50:25+00:00",
        "email_writers": true,
        "no_public_forks": false,
        "resource_uri": "/1.0/repositories/auserbb/myowncode"
    },
    {
        "scm": "git",
        "has_wiki": false,
        "last_updated": "2012-07-12 01:53:01",
        "creator": null,
        "created_on": "2012-07-12 01:53:01",
        "owner": "auserbb",
        "logo": null,
        "email_mailinglist": "",
        "is_mq": false,
        "size": 659,
        "read_only": false,
        "fork_of": {
            "scm": "git",
            "has_wiki": false,
            "last_updated": "2012-06-27 00:22:15",
            "creator": null,
            "created_on": "2012-06-27 00:22:15",
            "owner": "1team",
            "logo": null,
            "email_mailinglist": "",
            "is_mq": false,
            "size": 580,
            "read_only": false,
            "fork_of": null,
            "mq_of": null,
            "followers_count": 2,
            "state": "available",
            "utc_created_on": "2012-06-26 22:22:15+00:00",
            "website": "",
            "description": "",
            "has_issues": false,
            "is_fork": false,
            "slug": "justdirectteam",
            "is_private": true,
            "name": "justdirectteam",
            "language": "",
            "utc_last_updated": "2012-06-26 22:22:15+00:00",
            "email_writers": true,
            "no_public_forks": false,
            "resource_uri": "/1.0/repositories/1team/justdirectteam"
        },
        "mq_of": null,
        "followers_count": 1,
        "state": "available",
        "utc_created_on": "2012-07-11 23:53:01+00:00",
        "website": null,
        "description": "",
        "has_issues": false,
        "is_fork": true,
        "slug": "auser-justdirectteam",
        "is_private": true,
        "name": "auser-justdirectteam",
        "language": "",
        "utc_last_updated": "2012-07-11 23:53:01+00:00",
        "email_writers": true,
        "no_public_forks": false,
        "resource_uri": "/1.0/repositories/auserbb/auser-justdirectteam"
    }
]

1 つのアカウントが表示可能なリポジトリ一覧の取得

ユーザーが保有しているか、読み取り以上の権限を持っているリポジトリの詳細を取得します。ユーザーに関連付けられたすべてのリポジトリの完全な一覧が必要な場合、これを使用します。

GET https://api.bitbucket.org/1.0/user/repositories
クリックしてレスポンスを展開...

In the example below, auser-justdirectteam is a fork of the team's justdirectteam repository.

 [
    {
        "scm": "git",
        "has_wiki": false,
        "last_updated": "2012-06-27 00:22:15",
        "creator": null,
        "created_on": "2012-06-27 00:22:15",
        "owner": "1team",
        "logo": null,
        "email_mailinglist": "",
        "is_mq": false,
        "size": 580,
        "read_only": false,
        "fork_of": null,
        "mq_of": null,
        "followers_count": 2,
        "state": "available",
        "utc_created_on": "2012-06-26 22:22:15+00:00",
        "website": "",
        "description": "",
        "has_issues": false,
        "is_fork": false,
        "slug": "justdirectteam",
        "is_private": true,
        "name": "justdirectteam",
        "language": "",
        "utc_last_updated": "2012-06-26 22:22:15+00:00",
        "email_writers": true,
        "no_public_forks": false,
        "resource_uri": "/1.0/repositories/1team/justdirectteam"
    },
    {
        "scm": "hg",
        "has_wiki": false,
        "last_updated": "2012-07-12 01:50:25",
        "creator": null,
        "created_on": "2012-07-12 01:50:25",
        "owner": "auserbb",
        "logo": null,
        "email_mailinglist": "",
        "is_mq": false,
        "size": 541,
        "read_only": false,
        "fork_of": null,
        "mq_of": null,
        "followers_count": 1,
        "state": "available",
        "utc_created_on": "2012-07-11 23:50:25+00:00",
        "website": "",
        "description": "",
        "has_issues": false,
        "is_fork": false,
        "slug": "myowncode",
        "is_private": true,
        "name": "myowncode",
        "language": "",
        "utc_last_updated": "2012-07-11 23:50:25+00:00",
        "email_writers": true,
        "no_public_forks": false,
        "resource_uri": "/1.0/repositories/auserbb/myowncode"
    },
    {
        "scm": "git",
        "has_wiki": false,
        "last_updated": "2012-07-12 01:53:01",
        "creator": null,
        "created_on": "2012-07-12 01:53:01",
        "owner": "auserbb",
        "logo": null,
        "email_mailinglist": "",
        "is_mq": false,
        "size": 659,
        "read_only": false,
        "fork_of": {
            "scm": "git",
            "has_wiki": false,
            "last_updated": "2012-06-27 00:22:15",
            "creator": null,
            "created_on": "2012-06-27 00:22:15",
            "owner": "1team",
            "logo": null,
            "email_mailinglist": "",
            "is_mq": false,
            "size": 580,
            "read_only": false,
            "fork_of": null,
            "mq_of": null,
            "followers_count": 2,
            "state": "available",
            "utc_created_on": "2012-06-26 22:22:15+00:00",
            "website": "",
            "description": "",
            "has_issues": false,
            "is_fork": false,
            "slug": "justdirectteam",
            "is_private": true,
            "name": "justdirectteam",
            "language": "",
            "utc_last_updated": "2012-06-26 22:22:15+00:00",
            "email_writers": true,
            "no_public_forks": false,
            "resource_uri": "/1.0/repositories/1team/justdirectteam"
        },
        "mq_of": null,
        "followers_count": 1,
        "state": "available",
        "utc_created_on": "2012-07-11 23:53:01+00:00",
        "website": null,
        "description": "",
        "has_issues": false,
        "is_fork": true,
        "slug": "auser-justdirectteam",
        "is_private": true,
        "name": "auser-justdirectteam",
        "language": "",
        "utc_last_updated": "2012-07-11 23:53:01+00:00",
        "email_writers": true,
        "no_public_forks": false,
        "resource_uri": "/1.0/repositories/auserbb/auser-justdirectteam"
    }
]

アカウントがフォローしているリポジトリ一覧の取得

アカウントがフォローしているリポジトリの一覧を取得します。アカウントのダッシュボードの [フォロー] タブに表示される一覧と同じ情報です。

GET https://api.bitbucket.org/1.0/user/repositories/overview
クリックしてレスポンスを展開...
{
    "updated": [
        {
            "owner": "auserbb",
            "name": "auser-justdirectteam",
            "slug": "auser-justdirectteam",
            "is_private": true,
            "avatar": "https://secure.gravatar.com/avatar/49bd0ee69e520e8bc250adb95710bbb8?d=identicon&s=16"
        },
        {
            "owner": "auserbb",
            "name": "myowncode",
            "slug": "myowncode",
            "is_private": true,
            "avatar": "https://secure.gravatar.com/avatar/49bd0ee69e520e8bc250adb95710bbb8?d=identicon&s=16"
        },
        {
            "owner": "1team",
            "name": "justdirectteam",
            "slug": "justdirectteam",
            "is_private": true,
            "avatar": "https://secure.gravatar.com/avatar/24b6be68b53e383c5d42bab4fe0bde2b?d=https%3A%2F%2Fdwz7u9t8u8usb.clou
dfront.net%2Fm%2Fe7650dc4b9dd%2Fimg%2Fteam_no_avatar.png&s=16"
        }
    ],
    "viewed": []
}

ダッシュボードのリポジトリ一覧の取得

アカウントのダッシュボードからリポジトリの一覧を取得します。

GET https://api.bitbucket.org/1.0/user/repositories/dashboard
クリックしてレスポンスを展開...
[
    [
        {
            "username": "buserbb",
            "first_name": "B",
            "last_name": "userbb",
            "is_team": false,
            "avatar": "https://secure.gravatar.com/avatar/b677e1e3bf1c781f852b288fd4b68480?d=https%3A%2F%2Fdwz7u9t8u8usb.cloudfront.net%2Fm%2F33b98326237f%2Fimg%2Fdefault_avatar%2F32%2Fuser_blue.png&s=32",
            "resource_uri": "/1.0/users/buserbb"
        },
        [
            {
                "website": "",
                "fork": false,
                "name": "mybuserrepo",
                "scm": "git",
                "absolute_url": "/buserbb/mybuserrepo/",
                "_pk": 1046047,
                "owner": "buserbb",
                "slug": "mybuserrepo",
                "is_private": true
            },
            {
                "website": null,
                "fork": "/tutorials/tutorials.bitbucket.org",
                "name": "myquotefork",
                "scm": "hg",
                "absolute_url": "/buserbb/myquotefork/",
                "_pk": 1446971,
                "owner": "buserbb",
                "slug": "myquotefork",
                "is_private": false
            }
        ]
    ],
    [
        {
            "username": "2team",
            "first_name": "2 Team",
            "last_name": "",
            "is_team": true,
            "avatar": "https://secure.gravatar.com/avatar/15827007bdb707832ded90a612750cfb?d=https%3A%2F%2Fdwz7u9t8u8usb.cloudfront.net%2Fm%2F33b98326237f%2Fimg%2Fdefault_team_avatar%2F32%2Fteam_blue.png&s=32",
            "resource_uri": "/1.0/users/2team"
        },
        [
            {
                "website": "",
                "fork": false,
                "name": "teamproject",
                "scm": "git",
                "absolute_url": "/2team/teamproject/",
                "_pk": 1088776,
                "owner": "2team",
                "slug": "teamproject",
                "is_private": true
            },
            {
                "website": "",
                "fork": false,
                "name": "public2teamrepo",
                "scm": "hg",
                "absolute_url": "/2team/public2teamrepo/",
                "_pk": 1181363,
                "owner": "2team",
                "slug": "public2teamrepo",
                "is_private": false
            }
        ]
    ]
] 
最終更新日 2018 年 6 月 14 日

この内容はお役に立ちましたか?

はい
いいえ
この記事についてのフィードバックを送信する
Powered by Confluence and Scroll Viewport.