invitations エンドポイント
Bitbucket Cloud v1 API は廃止予定です
Bitbucket Cloud REST API バージョン 1 は 2018 年 6 月 30 日に廃止予定となり、2019 年 4 月 29 日に REST API から完全に削除されました。廃止についての告知をご確認ください。または、バージョン 2.0 の REST API ドキュメントをご確認ください。
限られた 1.0 API リソースの一時的なサポートについて
The 2.0 REST API will rely on the Atlassian Cloud Admin API for user and group management, but those API endpoints are not yet available. Until the Atlassian platform services are fully available in Bitbucket we will continue to support these 1.0 REST endpoints:
概要
The invitations
endpoint allows Bitbucket Cloud repository administrators to send email invitations to grant read, write, or admin privileges to a repository. The email sent to a user includes a URL for accepting the invitation. If the recipient already has a Bitbucket account corresponding to that email address, he or she must log into that account to access the repository. If the user does not have a Bitbucket account, the user must create a Bitbucket account before accessing the repository. An invitation endpoint has the following fields:
{
"sent_on": "2011-01-11 01:03:31",
"permission": "write",
"invited_by": {
"display_name": "Roger",
"account_id": "557058:ec25fab6-5844-4b65-a30c-677ecd2ce3b5",
"is_team": false,
"avatar": "https://avatar-management--avatars.us-west-2.prod.public.atl-paas.net/initials/CS-5.png",
"resource_uri": "/api/1.0/users/roger",
"nickname": "roger",
"uuid": "{746046c8-9d5a-4b86-a414-485452396952}"
},
"repository": {
"website": "",
"read_only": false,
"has_wiki": true,
"last_updated": "2010-12-24 05:26:20",
"name": "ramjet",
"language": "",
"deleted": false,
"is_mq": false,
"mq_of": null,
"created_on": "2010-12-24 05:26:20",
"fork_of": null,
"email_writers": true,
"size": 4096,
"owner": "roger",
"has_issues": true,
"no_public_forks": false,
"email_mailinglist": "",
"is_fork": false,
"slug": "ramjet",
"is_private": true,
"description": ""
},
"email": "john@example.com"
}
これらのフィールドは次のとおりです。
フィールド | 説明 |
---|---|
sent_on | ユーザーが招待された 1 つ以上のアカウント グループ。 |
permission | リポジトリに付与された権限。次のいずれかです。
|
invited by | 招待元ユーザーのユーザー プロファイル。 |
repository | ユーザーが招待されたリポジトリ。 |
email | 招待の外部メール |
POST による招待の送信
POST https://api.bitbucket.org/1.0/invitations/{accountname}/{repo_slug} --data 'permission={permission}' --data 'email={email_address}'
ユーザーをリポジトリに招待します。このメソッドでは次のパラメータを使用できます。
パラメーター | 必須かどうか | 説明 |
---|---|---|
accountname | はい | チームまたは個人のアカウント。 |
repo_slug | はい | そのアカウントに所属しているリポジトリ。 |
email_address | はい | メール受信者 |
permission | はい | 受信者に付与される権限 |
john@example.com
にリポジトリ roger/ramjet
への書き込み権限を付与する招待を送信するには、次のようにします。
$ curl --user roger:password --request POST https://api.bitbucket.org/1.0/invitations/roger/ramjet --data permission=write --data email=john@example.com
応答は次のようになります。