Skip to main content
ドキュメントには� �繁に更新が� えられ、その都度公開されています。本ページの翻訳はま� 未完成な部分があることをご了承く� さい。最新の情� �については、英語のドキュメンテーションをご参照く� さい。本ページの翻訳に問題がある� �合はこちらまでご連絡く� さい。

このバージョンの GitHub Enterprise はこの日付をもって終了となりました: 2022-06-03. 重大なセキュリティの問題に対してであっても、パッチリリースは作成されません。 パフォーマンスの向上、セキュリティの改善、新機能のためには、最新バージョンのGitHub Enterpriseにアップグレードしてく� さい。 アップグレードに関する支援については、GitHub Enterprise supportに連絡してく� さい。

リアクション

Reactions APIを使うと、コメントのリアクションの作成、リスト、削除が行えます。

Reactions APIについて

Reactions APIを使うと、コメントのリアクションの作成と管理ができます。 リアクションを作成する際、contentパラメータで利用可能な値は以下の通りです (参考のため、対応する絵文字も掲載します)。

内容絵文字
+1👍
-1👎
笑い😄
混乱😕
heart❤️
万歳🎉
ロケット🚀
👀

List reactions for a team discussion comment

Works with GitHub Apps

List the reactions to a team discussion comment. OAuth access tokens require the read:discussion scope.

Note: You can also specify a team by org_id and team_id using the route GET /organizations/:org_id/team/:team_id/discussions/:discussion_number/comments/:comment_number/reactions.

パラメータ

Headers
名前, 種類, 説明
acceptstring

Setting to application/vnd.github.v3+json is recommended.

プレビューの通知を見る
Path parameters
名前, 種類, 説明
orgstring必� �

The organization name. The name is not case sensitive.

team_slugstring必� �

The slug of the team name.

discussion_numberinteger必� �

The number that identifies the discussion.

comment_numberinteger必� �

The number that identifies the comment.

クエリパラメータ
名前, 種類, 説明
contentstring

Returns a single reaction type. Omit this parameter to list all reactions to a team discussion comment.

Can be one of: +1, -1, laugh, confused, heart, hooray, rocket, eyes

per_pageinteger

The number of results per page (max 100).

デフォルト: 30

pageinteger

Page number of the results to fetch.

デフォルト: 1

HTTP response status codes

Status code説明
200

OK

コードサンプル

get/orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions
curl \ -H "Accept: application/vnd.github.v3+json" \ -H "Authorization: token <TOKEN>" \ http(s)://HOSTNAME/api/v3/orgs/ORG/teams/TEAM_SLUG/discussions/DISCUSSION_NUMBER/comments/COMMENT_NUMBER/reactions

Response

Status: 200
[ { "id": 1, "node_id": "MDg6UmVhY3Rpb24x", "user": { "login": "octocat", "id": 1, "node_id": "MDQ6VXNlcjE=", "avatar_url": "https://github.com/images/error/octocat_happy.gif", "gravatar_id": "", "url": "https://api.github.com/users/octocat", "html_url": "https://github.com/octocat", "followers_url": "https://api.github.com/users/octocat/followers", "following_url": "https://api.github.com/users/octocat/following{/other_user}", "gists_url": "https://api.github.com/users/octocat/gists{/gist_id}", "starred_url": "https://api.github.com/users/octocat/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/octocat/subscriptions", "organizations_url": "https://api.github.com/users/octocat/orgs", "repos_url": "https://api.github.com/users/octocat/repos", "events_url": "https://api.github.com/users/octocat/events{/privacy}", "received_events_url": "https://api.github.com/users/octocat/received_events", "type": "User", "site_admin": false }, "content": "heart", "created_at": "2016-05-20T20:09:31Z" } ]

プレビュー通知

An additional reactions object in the issue comment payload is currently available for developers to preview. During the preview period, the APIs may change without advance notice. Please see the blog post for full details.

To access the API you must provide a custom media type in the Accept header:

application/vnd.github.squirrel-girl-preview

The reactions key will have the following payload where url can be used to construct the API location for listing and creating reactions.

Create reaction for a team discussion comment

Works with GitHub Apps

Create a reaction to a team discussion comment. OAuth access tokens require the write:discussion scope. A response with an HTTP 200 status means that you already added the reaction type to this team discussion comment.

Note: You can also specify a team by org_id and team_id using the route POST /organizations/:org_id/team/:team_id/discussions/:discussion_number/comments/:comment_number/reactions.

パラメータ

Headers
名前, 種類, 説明
acceptstring

Setting to application/vnd.github.v3+json is recommended.

プレビューの通知を見る
Path parameters
名前, 種類, 説明
orgstring必� �

The organization name. The name is not case sensitive.

team_slugstring必� �

The slug of the team name.

discussion_numberinteger必� �

The number that identifies the discussion.

comment_numberinteger必� �

The number that identifies the comment.

Body parameters
名前, 種類, 説明
contentstring必� �

The reaction type to add to the team discussion comment.

Can be one of: +1, -1, laugh, confused, heart, hooray, rocket, eyes

HTTP response status codes

Status code説明
200

Response when the reaction type has already been added to this team discussion comment

201

Created

コードサンプル

post/orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions
curl \ -X POST \ -H "Accept: application/vnd.github.v3+json" \ -H "Authorization: token <TOKEN>" \ http(s)://HOSTNAME/api/v3/orgs/ORG/teams/TEAM_SLUG/discussions/DISCUSSION_NUMBER/comments/COMMENT_NUMBER/reactions \ -d '{"content":"heart"}'

Response when the reaction type has already been added to this team discussion comment

Status: 200
{ "id": 1, "node_id": "MDg6UmVhY3Rpb24x", "user": { "login": "octocat", "id": 1, "node_id": "MDQ6VXNlcjE=", "avatar_url": "https://github.com/images/error/octocat_happy.gif", "gravatar_id": "", "url": "https://api.github.com/users/octocat", "html_url": "https://github.com/octocat", "followers_url": "https://api.github.com/users/octocat/followers", "following_url": "https://api.github.com/users/octocat/following{/other_user}", "gists_url": "https://api.github.com/users/octocat/gists{/gist_id}", "starred_url": "https://api.github.com/users/octocat/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/octocat/subscriptions", "organizations_url": "https://api.github.com/users/octocat/orgs", "repos_url": "https://api.github.com/users/octocat/repos", "events_url": "https://api.github.com/users/octocat/events{/privacy}", "received_events_url": "https://api.github.com/users/octocat/received_events", "type": "User", "site_admin": false }, "content": "heart", "created_at": "2016-05-20T20:09:31Z" }

プレビュー通知

An additional reactions object in the issue comment payload is currently available for developers to preview. During the preview period, the APIs may change without advance notice. Please see the blog post for full details.

To access the API you must provide a custom media type in the Accept header:

application/vnd.github.squirrel-girl-preview

The reactions key will have the following payload where url can be used to construct the API location for listing and creating reactions.

Delete team discussion comment reaction

Works with GitHub Apps

Note: You can also specify a team or organization with team_id and org_id using the route DELETE /organizations/:org_id/team/:team_id/discussions/:discussion_number/comments/:comment_number/reactions/:reaction_id.

Delete a reaction to a team discussion comment. OAuth access tokens require the write:discussion scope.

パラメータ

Headers
名前, 種類, 説明
acceptstring

Setting to application/vnd.github.v3+json is recommended.

プレビューの通知を見る
Path parameters
名前, 種類, 説明
orgstring必� �

The organization name. The name is not case sensitive.

team_slugstring必� �

The slug of the team name.

discussion_numberinteger必� �

The number that identifies the discussion.

comment_numberinteger必� �

The number that identifies the comment.

reaction_idinteger必� �

The unique identifier of the reaction.

HTTP response status codes

Status code説明
204

No Content

コードサンプル

delete/orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions/{reaction_id}
curl \ -X DELETE \ -H "Accept: application/vnd.github.v3+json" \ -H "Authorization: token <TOKEN>" \ http(s)://HOSTNAME/api/v3/orgs/ORG/teams/TEAM_SLUG/discussions/DISCUSSION_NUMBER/comments/COMMENT_NUMBER/reactions/REACTION_ID

Response

Status: 204

プレビュー通知

An additional reactions object in the issue comment payload is currently available for developers to preview. During the preview period, the APIs may change without advance notice. Please see the blog post for full details.

To access the API you must provide a custom media type in the Accept header:

application/vnd.github.squirrel-girl-preview

The reactions key will have the following payload where url can be used to construct the API location for listing and creating reactions.

List reactions for a team discussion

Works with GitHub Apps

List the reactions to a team discussion. OAuth access tokens require the read:discussion scope.

Note: You can also specify a team by org_id and team_id using the route GET /organizations/:org_id/team/:team_id/discussions/:discussion_number/reactions.

パラメータ

Headers
名前, 種類, 説明
acceptstring

Setting to application/vnd.github.v3+json is recommended.

プレビューの通知を見る
Path parameters
名前, 種類, 説明
orgstring必� �

The organization name. The name is not case sensitive.

team_slugstring必� �

The slug of the team name.

discussion_numberinteger必� �

The number that identifies the discussion.

クエリパラメータ
名前, 種類, 説明
contentstring

Returns a single reaction type. Omit this parameter to list all reactions to a team discussion.

Can be one of: +1, -1, laugh, confused, heart, hooray, rocket, eyes

per_pageinteger

The number of results per page (max 100).

デフォルト: 30

pageinteger

Page number of the results to fetch.

デフォルト: 1

HTTP response status codes

Status code説明
200

OK

コードサンプル

get/orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions
curl \ -H "Accept: application/vnd.github.v3+json" \ -H "Authorization: token <TOKEN>" \ http(s)://HOSTNAME/api/v3/orgs/ORG/teams/TEAM_SLUG/discussions/DISCUSSION_NUMBER/reactions

Response

Status: 200
[ { "id": 1, "node_id": "MDg6UmVhY3Rpb24x", "user": { "login": "octocat", "id": 1, "node_id": "MDQ6VXNlcjE=", "avatar_url": "https://github.com/images/error/octocat_happy.gif", "gravatar_id": "", "url": "https://api.github.com/users/octocat", "html_url": "https://github.com/octocat", "followers_url": "https://api.github.com/users/octocat/followers", "following_url": "https://api.github.com/users/octocat/following{/other_user}", "gists_url": "https://api.github.com/users/octocat/gists{/gist_id}", "starred_url": "https://api.github.com/users/octocat/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/octocat/subscriptions", "organizations_url": "https://api.github.com/users/octocat/orgs", "repos_url": "https://api.github.com/users/octocat/repos", "events_url": "https://api.github.com/users/octocat/events{/privacy}", "received_events_url": "https://api.github.com/users/octocat/received_events", "type": "User", "site_admin": false }, "content": "heart", "created_at": "2016-05-20T20:09:31Z" } ]

プレビュー通知

An additional reactions object in the issue comment payload is currently available for developers to preview. During the preview period, the APIs may change without advance notice. Please see the blog post for full details.

To access the API you must provide a custom media type in the Accept header:

application/vnd.github.squirrel-girl-preview

The reactions key will have the following payload where url can be used to construct the API location for listing and creating reactions.

Create reaction for a team discussion

Create a reaction to a team discussion. OAuth access tokens require the write:discussion scope. A response with an HTTP 200 status means that you already added the reaction type to this team discussion.

Note: You can also specify a team by org_id and team_id using the route POST /organizations/:org_id/team/:team_id/discussions/:discussion_number/reactions.

パラメータ

Headers
名前, 種類, 説明
acceptstring

Setting to application/vnd.github.v3+json is recommended.

プレビューの通知を見る
Path parameters
名前, 種類, 説明
orgstring必� �

The organization name. The name is not case sensitive.

team_slugstring必� �

The slug of the team name.

discussion_numberinteger必� �

The number that identifies the discussion.

Body parameters
名前, 種類, 説明
contentstring必� �

The reaction type to add to the team discussion.

Can be one of: +1, -1, laugh, confused, heart, hooray, rocket, eyes

HTTP response status codes

Status code説明
200

OK

201

Created

コードサンプル

post/orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions
curl \ -X POST \ -H "Accept: application/vnd.github.v3+json" \ -H "Authorization: token <TOKEN>" \ http(s)://HOSTNAME/api/v3/orgs/ORG/teams/TEAM_SLUG/discussions/DISCUSSION_NUMBER/reactions \ -d '{"content":"heart"}'

Response

Status: 200
{ "id": 1, "node_id": "MDg6UmVhY3Rpb24x", "user": { "login": "octocat", "id": 1, "node_id": "MDQ6VXNlcjE=", "avatar_url": "https://github.com/images/error/octocat_happy.gif", "gravatar_id": "", "url": "https://api.github.com/users/octocat", "html_url": "https://github.com/octocat", "followers_url": "https://api.github.com/users/octocat/followers", "following_url": "https://api.github.com/users/octocat/following{/other_user}", "gists_url": "https://api.github.com/users/octocat/gists{/gist_id}", "starred_url": "https://api.github.com/users/octocat/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/octocat/subscriptions", "organizations_url": "https://api.github.com/users/octocat/orgs", "repos_url": "https://api.github.com/users/octocat/repos", "events_url": "https://api.github.com/users/octocat/events{/privacy}", "received_events_url": "https://api.github.com/users/octocat/received_events", "type": "User", "site_admin": false }, "content": "heart", "created_at": "2016-05-20T20:09:31Z" }

プレビュー通知

An additional reactions object in the issue comment payload is currently available for developers to preview. During the preview period, the APIs may change without advance notice. Please see the blog post for full details.

To access the API you must provide a custom media type in the Accept header:

application/vnd.github.squirrel-girl-preview

The reactions key will have the following payload where url can be used to construct the API location for listing and creating reactions.

Delete team discussion reaction

Works with GitHub Apps

Note: You can also specify a team or organization with team_id and org_id using the route DELETE /organizations/:org_id/team/:team_id/discussions/:discussion_number/reactions/:reaction_id.

Delete a reaction to a team discussion. OAuth access tokens require the write:discussion scope.

パラメータ

Headers
名前, 種類, 説明
acceptstring

Setting to application/vnd.github.v3+json is recommended.

プレビューの通知を見る
Path parameters
名前, 種類, 説明
orgstring必� �

The organization name. The name is not case sensitive.

team_slugstring必� �

The slug of the team name.

discussion_numberinteger必� �

The number that identifies the discussion.

reaction_idinteger必� �

The unique identifier of the reaction.

HTTP response status codes

Status code説明
204

No Content

コードサンプル

delete/orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions/{reaction_id}
curl \ -X DELETE \ -H "Accept: application/vnd.github.v3+json" \ -H "Authorization: token <TOKEN>" \ http(s)://HOSTNAME/api/v3/orgs/ORG/teams/TEAM_SLUG/discussions/DISCUSSION_NUMBER/reactions/REACTION_ID

Response

Status: 204

プレビュー通知

An additional reactions object in the issue comment payload is currently available for developers to preview. During the preview period, the APIs may change without advance notice. Please see the blog post for full details.

To access the API you must provide a custom media type in the Accept header:

application/vnd.github.squirrel-girl-preview

The reactions key will have the following payload where url can be used to construct the API location for listing and creating reactions.

Delete a reaction (Legacy)

Works with GitHub Apps

Deprecation Notice: This endpoint route is deprecated and will be removed from the Reactions API. We recommend migrating your existing code to use the new delete reactions endpoints. For more information, see this blog post.

OAuth access tokens require the write:discussion scope, when deleting a team discussion or team discussion comment.

パラメータ

Headers
名前, 種類, 説明
acceptstring

Setting to application/vnd.github.v3+json is recommended.

プレビューの通知を見る
Path parameters
名前, 種類, 説明
reaction_idinteger必� �

The unique identifier of the reaction.

HTTP response status codes

Status code説明
204

No Content

304

Not modified

401

Requires authentication

403

Forbidden

410

Gone

コードサンプル

delete/reactions/{reaction_id}
curl \ -X DELETE \ -H "Accept: application/vnd.github.v3+json" \ -H "Authorization: token <TOKEN>" \ http(s)://HOSTNAME/api/v3/reactions/REACTION_ID

Response

Status: 204

プレビュー通知

An additional reactions object in the issue comment payload is currently available for developers to preview. During the preview period, the APIs may change without advance notice. Please see the blog post for full details.

To access the API you must provide a custom media type in the Accept header:

application/vnd.github.squirrel-girl-preview

The reactions key will have the following payload where url can be used to construct the API location for listing and creating reactions.

List reactions for a commit comment

Works with GitHub Apps

List the reactions to a commit comment.

パラメータ

Headers
名前, 種類, 説明
acceptstring

Setting to application/vnd.github.v3+json is recommended.

プレビューの通知を見る
Path parameters
名前, 種類, 説明
ownerstring必� �

The account owner of the repository. The name is not case sensitive.

repostring必� �

The name of the repository. The name is not case sensitive.

comment_idinteger必� �

The unique identifier of the comment.

クエリパラメータ
名前, 種類, 説明
contentstring

Returns a single reaction type. Omit this parameter to list all reactions to a commit comment.

Can be one of: +1, -1, laugh, confused, heart, hooray, rocket, eyes

per_pageinteger

The number of results per page (max 100).

デフォルト: 30

pageinteger

Page number of the results to fetch.

デフォルト: 1

HTTP response status codes

Status code説明
200

OK

404

Resource not found

コードサンプル

get/repos/{owner}/{repo}/comments/{comment_id}/reactions
curl \ -H "Accept: application/vnd.github.v3+json" \ -H "Authorization: token <TOKEN>" \ http(s)://HOSTNAME/api/v3/repos/OWNER/REPO/comments/COMMENT_ID/reactions

Response

Status: 200
[ { "id": 1, "node_id": "MDg6UmVhY3Rpb24x", "user": { "login": "octocat", "id": 1, "node_id": "MDQ6VXNlcjE=", "avatar_url": "https://github.com/images/error/octocat_happy.gif", "gravatar_id": "", "url": "https://api.github.com/users/octocat", "html_url": "https://github.com/octocat", "followers_url": "https://api.github.com/users/octocat/followers", "following_url": "https://api.github.com/users/octocat/following{/other_user}", "gists_url": "https://api.github.com/users/octocat/gists{/gist_id}", "starred_url": "https://api.github.com/users/octocat/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/octocat/subscriptions", "organizations_url": "https://api.github.com/users/octocat/orgs", "repos_url": "https://api.github.com/users/octocat/repos", "events_url": "https://api.github.com/users/octocat/events{/privacy}", "received_events_url": "https://api.github.com/users/octocat/received_events", "type": "User", "site_admin": false }, "content": "heart", "created_at": "2016-05-20T20:09:31Z" } ]

プレビュー通知

An additional reactions object in the issue comment payload is currently available for developers to preview. During the preview period, the APIs may change without advance notice. Please see the blog post for full details.

To access the API you must provide a custom media type in the Accept header:

application/vnd.github.squirrel-girl-preview

The reactions key will have the following payload where url can be used to construct the API location for listing and creating reactions.

Create reaction for a commit comment

Works with GitHub Apps

Create a reaction to a commit comment. A response with an HTTP 200 status means that you already added the reaction type to this commit comment.

パラメータ

Headers
名前, 種類, 説明
acceptstring

Setting to application/vnd.github.v3+json is recommended.

プレビューの通知を見る
Path parameters
名前, 種類, 説明
ownerstring必� �

The account owner of the repository. The name is not case sensitive.

repostring必� �

The name of the repository. The name is not case sensitive.

comment_idinteger必� �

The unique identifier of the comment.

Body parameters
名前, 種類, 説明
contentstring必� �

The reaction type to add to the commit comment.

Can be one of: +1, -1, laugh, confused, heart, hooray, rocket, eyes

HTTP response status codes

Status code説明
200

Reaction exists

201

Reaction created

415

Preview header missing

422

Validation failed

コードサンプル

post/repos/{owner}/{repo}/comments/{comment_id}/reactions
curl \ -X POST \ -H "Accept: application/vnd.github.v3+json" \ -H "Authorization: token <TOKEN>" \ http(s)://HOSTNAME/api/v3/repos/OWNER/REPO/comments/COMMENT_ID/reactions \ -d '{"content":"heart"}'

Reaction exists

Status: 200
{ "id": 1, "node_id": "MDg6UmVhY3Rpb24x", "user": { "login": "octocat", "id": 1, "node_id": "MDQ6VXNlcjE=", "avatar_url": "https://github.com/images/error/octocat_happy.gif", "gravatar_id": "", "url": "https://api.github.com/users/octocat", "html_url": "https://github.com/octocat", "followers_url": "https://api.github.com/users/octocat/followers", "following_url": "https://api.github.com/users/octocat/following{/other_user}", "gists_url": "https://api.github.com/users/octocat/gists{/gist_id}", "starred_url": "https://api.github.com/users/octocat/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/octocat/subscriptions", "organizations_url": "https://api.github.com/users/octocat/orgs", "repos_url": "https://api.github.com/users/octocat/repos", "events_url": "https://api.github.com/users/octocat/events{/privacy}", "received_events_url": "https://api.github.com/users/octocat/received_events", "type": "User", "site_admin": false }, "content": "heart", "created_at": "2016-05-20T20:09:31Z" }

プレビュー通知

An additional reactions object in the issue comment payload is currently available for developers to preview. During the preview period, the APIs may change without advance notice. Please see the blog post for full details.

To access the API you must provide a custom media type in the Accept header:

application/vnd.github.squirrel-girl-preview

The reactions key will have the following payload where url can be used to construct the API location for listing and creating reactions.

Delete a commit comment reaction

Works with GitHub Apps

Note: You can also specify a repository by repository_id using the route DELETE /repositories/:repository_id/comments/:comment_id/reactions/:reaction_id.

Delete a reaction to a commit comment.

パラメータ

Headers
名前, 種類, 説明
acceptstring

Setting to application/vnd.github.v3+json is recommended.

プレビューの通知を見る
Path parameters
名前, 種類, 説明
ownerstring必� �

The account owner of the repository. The name is not case sensitive.

repostring必� �

The name of the repository. The name is not case sensitive.

comment_idinteger必� �

The unique identifier of the comment.

reaction_idinteger必� �

The unique identifier of the reaction.

HTTP response status codes

Status code説明
204

No Content

コードサンプル

delete/repos/{owner}/{repo}/comments/{comment_id}/reactions/{reaction_id}
curl \ -X DELETE \ -H "Accept: application/vnd.github.v3+json" \ -H "Authorization: token <TOKEN>" \ http(s)://HOSTNAME/api/v3/repos/OWNER/REPO/comments/COMMENT_ID/reactions/REACTION_ID

Response

Status: 204

プレビュー通知

An additional reactions object in the issue comment payload is currently available for developers to preview. During the preview period, the APIs may change without advance notice. Please see the blog post for full details.

To access the API you must provide a custom media type in the Accept header:

application/vnd.github.squirrel-girl-preview

The reactions key will have the following payload where url can be used to construct the API location for listing and creating reactions.

List reactions for an issue comment

Works with GitHub Apps

List the reactions to an issue comment.

パラメータ

Headers
名前, 種類, 説明
acceptstring

Setting to application/vnd.github.v3+json is recommended.

プレビューの通知を見る
Path parameters
名前, 種類, 説明
ownerstring必� �

The account owner of the repository. The name is not case sensitive.

repostring必� �

The name of the repository. The name is not case sensitive.

comment_idinteger必� �

The unique identifier of the comment.

クエリパラメータ
名前, 種類, 説明
contentstring

Returns a single reaction type. Omit this parameter to list all reactions to an issue comment.

Can be one of: +1, -1, laugh, confused, heart, hooray, rocket, eyes

per_pageinteger

The number of results per page (max 100).

デフォルト: 30

pageinteger

Page number of the results to fetch.

デフォルト: 1

HTTP response status codes

Status code説明
200

OK

404

Resource not found

コードサンプル

get/repos/{owner}/{repo}/issues/comments/{comment_id}/reactions
curl \ -H "Accept: application/vnd.github.v3+json" \ -H "Authorization: token <TOKEN>" \ http(s)://HOSTNAME/api/v3/repos/OWNER/REPO/issues/comments/COMMENT_ID/reactions

Response

Status: 200
[ { "id": 1, "node_id": "MDg6UmVhY3Rpb24x", "user": { "login": "octocat", "id": 1, "node_id": "MDQ6VXNlcjE=", "avatar_url": "https://github.com/images/error/octocat_happy.gif", "gravatar_id": "", "url": "https://api.github.com/users/octocat", "html_url": "https://github.com/octocat", "followers_url": "https://api.github.com/users/octocat/followers", "following_url": "https://api.github.com/users/octocat/following{/other_user}", "gists_url": "https://api.github.com/users/octocat/gists{/gist_id}", "starred_url": "https://api.github.com/users/octocat/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/octocat/subscriptions", "organizations_url": "https://api.github.com/users/octocat/orgs", "repos_url": "https://api.github.com/users/octocat/repos", "events_url": "https://api.github.com/users/octocat/events{/privacy}", "received_events_url": "https://api.github.com/users/octocat/received_events", "type": "User", "site_admin": false }, "content": "heart", "created_at": "2016-05-20T20:09:31Z" } ]

プレビュー通知

An additional reactions object in the issue comment payload is currently available for developers to preview. During the preview period, the APIs may change without advance notice. Please see the blog post for full details.

To access the API you must provide a custom media type in the Accept header:

application/vnd.github.squirrel-girl-preview

The reactions key will have the following payload where url can be used to construct the API location for listing and creating reactions.

Create reaction for an issue comment

Works with GitHub Apps

Create a reaction to an issue comment. A response with an HTTP 200 status means that you already added the reaction type to this issue comment.

パラメータ

Headers
名前, 種類, 説明
acceptstring

Setting to application/vnd.github.v3+json is recommended.

プレビューの通知を見る
Path parameters
名前, 種類, 説明
ownerstring必� �

The account owner of the repository. The name is not case sensitive.

repostring必� �

The name of the repository. The name is not case sensitive.

comment_idinteger必� �

The unique identifier of the comment.

Body parameters
名前, 種類, 説明
contentstring必� �

The reaction type to add to the issue comment.

Can be one of: +1, -1, laugh, confused, heart, hooray, rocket, eyes

HTTP response status codes

Status code説明
200

Reaction exists

201

Reaction created

422

Validation failed

コードサンプル

post/repos/{owner}/{repo}/issues/comments/{comment_id}/reactions
curl \ -X POST \ -H "Accept: application/vnd.github.v3+json" \ -H "Authorization: token <TOKEN>" \ http(s)://HOSTNAME/api/v3/repos/OWNER/REPO/issues/comments/COMMENT_ID/reactions \ -d '{"content":"heart"}'

Reaction exists

Status: 200
{ "id": 1, "node_id": "MDg6UmVhY3Rpb24x", "user": { "login": "octocat", "id": 1, "node_id": "MDQ6VXNlcjE=", "avatar_url": "https://github.com/images/error/octocat_happy.gif", "gravatar_id": "", "url": "https://api.github.com/users/octocat", "html_url": "https://github.com/octocat", "followers_url": "https://api.github.com/users/octocat/followers", "following_url": "https://api.github.com/users/octocat/following{/other_user}", "gists_url": "https://api.github.com/users/octocat/gists{/gist_id}", "starred_url": "https://api.github.com/users/octocat/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/octocat/subscriptions", "organizations_url": "https://api.github.com/users/octocat/orgs", "repos_url": "https://api.github.com/users/octocat/repos", "events_url": "https://api.github.com/users/octocat/events{/privacy}", "received_events_url": "https://api.github.com/users/octocat/received_events", "type": "User", "site_admin": false }, "content": "heart", "created_at": "2016-05-20T20:09:31Z" }

プレビュー通知

An additional reactions object in the issue comment payload is currently available for developers to preview. During the preview period, the APIs may change without advance notice. Please see the blog post for full details.

To access the API you must provide a custom media type in the Accept header:

application/vnd.github.squirrel-girl-preview

The reactions key will have the following payload where url can be used to construct the API location for listing and creating reactions.

Delete an issue comment reaction

Works with GitHub Apps

Note: You can also specify a repository by repository_id using the route DELETE delete /repositories/:repository_id/issues/comments/:comment_id/reactions/:reaction_id.

Delete a reaction to an issue comment.

パラメータ

Headers
名前, 種類, 説明
acceptstring

Setting to application/vnd.github.v3+json is recommended.

プレビューの通知を見る
Path parameters
名前, 種類, 説明
ownerstring必� �

The account owner of the repository. The name is not case sensitive.

repostring必� �

The name of the repository. The name is not case sensitive.

comment_idinteger必� �

The unique identifier of the comment.

reaction_idinteger必� �

The unique identifier of the reaction.

HTTP response status codes

Status code説明
204

No Content

コードサンプル

delete/repos/{owner}/{repo}/issues/comments/{comment_id}/reactions/{reaction_id}
curl \ -X DELETE \ -H "Accept: application/vnd.github.v3+json" \ -H "Authorization: token <TOKEN>" \ http(s)://HOSTNAME/api/v3/repos/OWNER/REPO/issues/comments/COMMENT_ID/reactions/REACTION_ID

Response

Status: 204

プレビュー通知

An additional reactions object in the issue comment payload is currently available for developers to preview. During the preview period, the APIs may change without advance notice. Please see the blog post for full details.

To access the API you must provide a custom media type in the Accept header:

application/vnd.github.squirrel-girl-preview

The reactions key will have the following payload where url can be used to construct the API location for listing and creating reactions.

List reactions for an issue

Works with GitHub Apps

List the reactions to an issue.

パラメータ

Headers
名前, 種類, 説明
acceptstring

Setting to application/vnd.github.v3+json is recommended.

プレビューの通知を見る
Path parameters
名前, 種類, 説明
ownerstring必� �

The account owner of the repository. The name is not case sensitive.

repostring必� �

The name of the repository. The name is not case sensitive.

issue_numberinteger必� �

The number that identifies the issue.

クエリパラメータ
名前, 種類, 説明
contentstring

Returns a single reaction type. Omit this parameter to list all reactions to an issue.

Can be one of: +1, -1, laugh, confused, heart, hooray, rocket, eyes

per_pageinteger

The number of results per page (max 100).

デフォルト: 30

pageinteger

Page number of the results to fetch.

デフォルト: 1

HTTP response status codes

Status code説明
200

OK

404

Resource not found

410

Gone

コードサンプル

get/repos/{owner}/{repo}/issues/{issue_number}/reactions
curl \ -H "Accept: application/vnd.github.v3+json" \ -H "Authorization: token <TOKEN>" \ http(s)://HOSTNAME/api/v3/repos/OWNER/REPO/issues/ISSUE_NUMBER/reactions

Response

Status: 200
[ { "id": 1, "node_id": "MDg6UmVhY3Rpb24x", "user": { "login": "octocat", "id": 1, "node_id": "MDQ6VXNlcjE=", "avatar_url": "https://github.com/images/error/octocat_happy.gif", "gravatar_id": "", "url": "https://api.github.com/users/octocat", "html_url": "https://github.com/octocat", "followers_url": "https://api.github.com/users/octocat/followers", "following_url": "https://api.github.com/users/octocat/following{/other_user}", "gists_url": "https://api.github.com/users/octocat/gists{/gist_id}", "starred_url": "https://api.github.com/users/octocat/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/octocat/subscriptions", "organizations_url": "https://api.github.com/users/octocat/orgs", "repos_url": "https://api.github.com/users/octocat/repos", "events_url": "https://api.github.com/users/octocat/events{/privacy}", "received_events_url": "https://api.github.com/users/octocat/received_events", "type": "User", "site_admin": false }, "content": "heart", "created_at": "2016-05-20T20:09:31Z" } ]

プレビュー通知

An additional reactions object in the issue comment payload is currently available for developers to preview. During the preview period, the APIs may change without advance notice. Please see the blog post for full details.

To access the API you must provide a custom media type in the Accept header:

application/vnd.github.squirrel-girl-preview

The reactions key will have the following payload where url can be used to construct the API location for listing and creating reactions.

Create reaction for an issue

Create a reaction to an issue. A response with an HTTP 200 status means that you already added the reaction type to this issue.

パラメータ

Headers
名前, 種類, 説明
acceptstring

Setting to application/vnd.github.v3+json is recommended.

プレビューの通知を見る
Path parameters
名前, 種類, 説明
ownerstring必� �

The account owner of the repository. The name is not case sensitive.

repostring必� �

The name of the repository. The name is not case sensitive.

issue_numberinteger必� �

The number that identifies the issue.

Body parameters
名前, 種類, 説明
contentstring必� �

The reaction type to add to the issue.

Can be one of: +1, -1, laugh, confused, heart, hooray, rocket, eyes

HTTP response status codes

Status code説明
200

OK

201

Created

422

Validation failed

コードサンプル

post/repos/{owner}/{repo}/issues/{issue_number}/reactions
curl \ -X POST \ -H "Accept: application/vnd.github.v3+json" \ -H "Authorization: token <TOKEN>" \ http(s)://HOSTNAME/api/v3/repos/OWNER/REPO/issues/ISSUE_NUMBER/reactions \ -d '{"content":"heart"}'

Response

Status: 200
{ "id": 1, "node_id": "MDg6UmVhY3Rpb24x", "user": { "login": "octocat", "id": 1, "node_id": "MDQ6VXNlcjE=", "avatar_url": "https://github.com/images/error/octocat_happy.gif", "gravatar_id": "", "url": "https://api.github.com/users/octocat", "html_url": "https://github.com/octocat", "followers_url": "https://api.github.com/users/octocat/followers", "following_url": "https://api.github.com/users/octocat/following{/other_user}", "gists_url": "https://api.github.com/users/octocat/gists{/gist_id}", "starred_url": "https://api.github.com/users/octocat/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/octocat/subscriptions", "organizations_url": "https://api.github.com/users/octocat/orgs", "repos_url": "https://api.github.com/users/octocat/repos", "events_url": "https://api.github.com/users/octocat/events{/privacy}", "received_events_url": "https://api.github.com/users/octocat/received_events", "type": "User", "site_admin": false }, "content": "heart", "created_at": "2016-05-20T20:09:31Z" }

プレビュー通知

An additional reactions object in the issue comment payload is currently available for developers to preview. During the preview period, the APIs may change without advance notice. Please see the blog post for full details.

To access the API you must provide a custom media type in the Accept header:

application/vnd.github.squirrel-girl-preview

The reactions key will have the following payload where url can be used to construct the API location for listing and creating reactions.

Delete an issue reaction

Works with GitHub Apps

Note: You can also specify a repository by repository_id using the route DELETE /repositories/:repository_id/issues/:issue_number/reactions/:reaction_id.

Delete a reaction to an issue.

パラメータ

Headers
名前, 種類, 説明
acceptstring

Setting to application/vnd.github.v3+json is recommended.

プレビューの通知を見る
Path parameters
名前, 種類, 説明
ownerstring必� �

The account owner of the repository. The name is not case sensitive.

repostring必� �

The name of the repository. The name is not case sensitive.

issue_numberinteger必� �

The number that identifies the issue.

reaction_idinteger必� �

The unique identifier of the reaction.

HTTP response status codes

Status code説明
204

No Content

コードサンプル

delete/repos/{owner}/{repo}/issues/{issue_number}/reactions/{reaction_id}
curl \ -X DELETE \ -H "Accept: application/vnd.github.v3+json" \ -H "Authorization: token <TOKEN>" \ http(s)://HOSTNAME/api/v3/repos/OWNER/REPO/issues/ISSUE_NUMBER/reactions/REACTION_ID

Response

Status: 204

プレビュー通知

An additional reactions object in the issue comment payload is currently available for developers to preview. During the preview period, the APIs may change without advance notice. Please see the blog post for full details.

To access the API you must provide a custom media type in the Accept header:

application/vnd.github.squirrel-girl-preview

The reactions key will have the following payload where url can be used to construct the API location for listing and creating reactions.

List reactions for a pull request review comment

Works with GitHub Apps

List the reactions to a pull request review comment.

パラメータ

Headers
名前, 種類, 説明
acceptstring

Setting to application/vnd.github.v3+json is recommended.

プレビューの通知を見る
Path parameters
名前, 種類, 説明
ownerstring必� �

The account owner of the repository. The name is not case sensitive.

repostring必� �

The name of the repository. The name is not case sensitive.

comment_idinteger必� �

The unique identifier of the comment.

クエリパラメータ
名前, 種類, 説明
contentstring

Returns a single reaction type. Omit this parameter to list all reactions to a pull request review comment.

Can be one of: +1, -1, laugh, confused, heart, hooray, rocket, eyes

per_pageinteger

The number of results per page (max 100).

デフォルト: 30

pageinteger

Page number of the results to fetch.

デフォルト: 1

HTTP response status codes

Status code説明
200

OK

404

Resource not found

コードサンプル

get/repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions
curl \ -H "Accept: application/vnd.github.v3+json" \ -H "Authorization: token <TOKEN>" \ http(s)://HOSTNAME/api/v3/repos/OWNER/REPO/pulls/comments/COMMENT_ID/reactions

Response

Status: 200
[ { "id": 1, "node_id": "MDg6UmVhY3Rpb24x", "user": { "login": "octocat", "id": 1, "node_id": "MDQ6VXNlcjE=", "avatar_url": "https://github.com/images/error/octocat_happy.gif", "gravatar_id": "", "url": "https://api.github.com/users/octocat", "html_url": "https://github.com/octocat", "followers_url": "https://api.github.com/users/octocat/followers", "following_url": "https://api.github.com/users/octocat/following{/other_user}", "gists_url": "https://api.github.com/users/octocat/gists{/gist_id}", "starred_url": "https://api.github.com/users/octocat/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/octocat/subscriptions", "organizations_url": "https://api.github.com/users/octocat/orgs", "repos_url": "https://api.github.com/users/octocat/repos", "events_url": "https://api.github.com/users/octocat/events{/privacy}", "received_events_url": "https://api.github.com/users/octocat/received_events", "type": "User", "site_admin": false }, "content": "heart", "created_at": "2016-05-20T20:09:31Z" } ]

プレビュー通知

An additional reactions object in the issue comment payload is currently available for developers to preview. During the preview period, the APIs may change without advance notice. Please see the blog post for full details.

To access the API you must provide a custom media type in the Accept header:

application/vnd.github.squirrel-girl-preview

The reactions key will have the following payload where url can be used to construct the API location for listing and creating reactions.

Create reaction for a pull request review comment

Works with GitHub Apps

Create a reaction to a pull request review comment. A response with an HTTP 200 status means that you already added the reaction type to this pull request review comment.

パラメータ

Headers
名前, 種類, 説明
acceptstring

Setting to application/vnd.github.v3+json is recommended.

プレビューの通知を見る
Path parameters
名前, 種類, 説明
ownerstring必� �

The account owner of the repository. The name is not case sensitive.

repostring必� �

The name of the repository. The name is not case sensitive.

comment_idinteger必� �

The unique identifier of the comment.

Body parameters
名前, 種類, 説明
contentstring必� �

The reaction type to add to the pull request review comment.

Can be one of: +1, -1, laugh, confused, heart, hooray, rocket, eyes

HTTP response status codes

Status code説明
200

Reaction exists

201

Reaction created

422

Validation failed

コードサンプル

post/repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions
curl \ -X POST \ -H "Accept: application/vnd.github.v3+json" \ -H "Authorization: token <TOKEN>" \ http(s)://HOSTNAME/api/v3/repos/OWNER/REPO/pulls/comments/COMMENT_ID/reactions \ -d '{"content":"heart"}'

Reaction exists

Status: 200
{ "id": 1, "node_id": "MDg6UmVhY3Rpb24x", "user": { "login": "octocat", "id": 1, "node_id": "MDQ6VXNlcjE=", "avatar_url": "https://github.com/images/error/octocat_happy.gif", "gravatar_id": "", "url": "https://api.github.com/users/octocat", "html_url": "https://github.com/octocat", "followers_url": "https://api.github.com/users/octocat/followers", "following_url": "https://api.github.com/users/octocat/following{/other_user}", "gists_url": "https://api.github.com/users/octocat/gists{/gist_id}", "starred_url": "https://api.github.com/users/octocat/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/octocat/subscriptions", "organizations_url": "https://api.github.com/users/octocat/orgs", "repos_url": "https://api.github.com/users/octocat/repos", "events_url": "https://api.github.com/users/octocat/events{/privacy}", "received_events_url": "https://api.github.com/users/octocat/received_events", "type": "User", "site_admin": false }, "content": "heart", "created_at": "2016-05-20T20:09:31Z" }

プレビュー通知

An additional reactions object in the issue comment payload is currently available for developers to preview. During the preview period, the APIs may change without advance notice. Please see the blog post for full details.

To access the API you must provide a custom media type in the Accept header:

application/vnd.github.squirrel-girl-preview

The reactions key will have the following payload where url can be used to construct the API location for listing and creating reactions.

Delete a pull request comment reaction

Works with GitHub Apps

Note: You can also specify a repository by repository_id using the route DELETE /repositories/:repository_id/pulls/comments/:comment_id/reactions/:reaction_id.

Delete a reaction to a pull request review comment.

パラメータ

Headers
名前, 種類, 説明
acceptstring

Setting to application/vnd.github.v3+json is recommended.

プレビューの通知を見る
Path parameters
名前, 種類, 説明
ownerstring必� �

The account owner of the repository. The name is not case sensitive.

repostring必� �

The name of the repository. The name is not case sensitive.

comment_idinteger必� �

The unique identifier of the comment.

reaction_idinteger必� �

The unique identifier of the reaction.

HTTP response status codes

Status code説明
204

No Content

コードサンプル

delete/repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions/{reaction_id}
curl \ -X DELETE \ -H "Accept: application/vnd.github.v3+json" \ -H "Authorization: token <TOKEN>" \ http(s)://HOSTNAME/api/v3/repos/OWNER/REPO/pulls/comments/COMMENT_ID/reactions/REACTION_ID

Response

Status: 204

プレビュー通知

An additional reactions object in the issue comment payload is currently available for developers to preview. During the preview period, the APIs may change without advance notice. Please see the blog post for full details.

To access the API you must provide a custom media type in the Accept header:

application/vnd.github.squirrel-girl-preview

The reactions key will have the following payload where url can be used to construct the API location for listing and creating reactions.

List reactions for a team discussion comment (Legacy)

Works with GitHub Apps

Deprecation Notice: This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new List reactions for a team discussion comment endpoint.

List the reactions to a team discussion comment. OAuth access tokens require the read:discussion scope.

パラメータ

Headers
名前, 種類, 説明
acceptstring

Setting to application/vnd.github.v3+json is recommended.

プレビューの通知を見る
Path parameters
名前, 種類, 説明
team_idinteger必� �

The unique identifier of the team.

discussion_numberinteger必� �

The number that identifies the discussion.

comment_numberinteger必� �

The number that identifies the comment.

クエリパラメータ
名前, 種類, 説明
contentstring

Returns a single reaction type. Omit this parameter to list all reactions to a team discussion comment.

Can be one of: +1, -1, laugh, confused, heart, hooray, rocket, eyes

per_pageinteger

The number of results per page (max 100).

デフォルト: 30

pageinteger

Page number of the results to fetch.

デフォルト: 1

HTTP response status codes

Status code説明
200

OK

コードサンプル

get/teams/{team_id}/discussions/{discussion_number}/comments/{comment_number}/reactions
curl \ -H "Accept: application/vnd.github.v3+json" \ -H "Authorization: token <TOKEN>" \ http(s)://HOSTNAME/api/v3/teams/TEAM_ID/discussions/DISCUSSION_NUMBER/comments/COMMENT_NUMBER/reactions

Response

Status: 200
[ { "id": 1, "node_id": "MDg6UmVhY3Rpb24x", "user": { "login": "octocat", "id": 1, "node_id": "MDQ6VXNlcjE=", "avatar_url": "https://github.com/images/error/octocat_happy.gif", "gravatar_id": "", "url": "https://api.github.com/users/octocat", "html_url": "https://github.com/octocat", "followers_url": "https://api.github.com/users/octocat/followers", "following_url": "https://api.github.com/users/octocat/following{/other_user}", "gists_url": "https://api.github.com/users/octocat/gists{/gist_id}", "starred_url": "https://api.github.com/users/octocat/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/octocat/subscriptions", "organizations_url": "https://api.github.com/users/octocat/orgs", "repos_url": "https://api.github.com/users/octocat/repos", "events_url": "https://api.github.com/users/octocat/events{/privacy}", "received_events_url": "https://api.github.com/users/octocat/received_events", "type": "User", "site_admin": false }, "content": "heart", "created_at": "2016-05-20T20:09:31Z" } ]

プレビュー通知

An additional reactions object in the issue comment payload is currently available for developers to preview. During the preview period, the APIs may change without advance notice. Please see the blog post for full details.

To access the API you must provide a custom media type in the Accept header:

application/vnd.github.squirrel-girl-preview

The reactions key will have the following payload where url can be used to construct the API location for listing and creating reactions.

Create reaction for a team discussion comment (Legacy)

Works with GitHub Apps

Deprecation Notice: This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new "Create reaction for a team discussion comment" endpoint.

Create a reaction to a team discussion comment. OAuth access tokens require the write:discussion scope. A response with an HTTP 200 status means that you already added the reaction type to this team discussion comment.

パラメータ

Headers
名前, 種類, 説明
acceptstring

Setting to application/vnd.github.v3+json is recommended.

プレビューの通知を見る
Path parameters
名前, 種類, 説明
team_idinteger必� �

The unique identifier of the team.

discussion_numberinteger必� �

The number that identifies the discussion.

comment_numberinteger必� �

The number that identifies the comment.

Body parameters
名前, 種類, 説明
contentstring必� �

The reaction type to add to the team discussion comment.

Can be one of: +1, -1, laugh, confused, heart, hooray, rocket, eyes

HTTP response status codes

Status code説明
201

Created

コードサンプル

post/teams/{team_id}/discussions/{discussion_number}/comments/{comment_number}/reactions
curl \ -X POST \ -H "Accept: application/vnd.github.v3+json" \ -H "Authorization: token <TOKEN>" \ http(s)://HOSTNAME/api/v3/teams/TEAM_ID/discussions/DISCUSSION_NUMBER/comments/COMMENT_NUMBER/reactions \ -d '{"content":"heart"}'

Response

Status: 201
{ "id": 1, "node_id": "MDg6UmVhY3Rpb24x", "user": { "login": "octocat", "id": 1, "node_id": "MDQ6VXNlcjE=", "avatar_url": "https://github.com/images/error/octocat_happy.gif", "gravatar_id": "", "url": "https://api.github.com/users/octocat", "html_url": "https://github.com/octocat", "followers_url": "https://api.github.com/users/octocat/followers", "following_url": "https://api.github.com/users/octocat/following{/other_user}", "gists_url": "https://api.github.com/users/octocat/gists{/gist_id}", "starred_url": "https://api.github.com/users/octocat/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/octocat/subscriptions", "organizations_url": "https://api.github.com/users/octocat/orgs", "repos_url": "https://api.github.com/users/octocat/repos", "events_url": "https://api.github.com/users/octocat/events{/privacy}", "received_events_url": "https://api.github.com/users/octocat/received_events", "type": "User", "site_admin": false }, "content": "heart", "created_at": "2016-05-20T20:09:31Z" }

プレビュー通知

An additional reactions object in the issue comment payload is currently available for developers to preview. During the preview period, the APIs may change without advance notice. Please see the blog post for full details.

To access the API you must provide a custom media type in the Accept header:

application/vnd.github.squirrel-girl-preview

The reactions key will have the following payload where url can be used to construct the API location for listing and creating reactions.

List reactions for a team discussion (Legacy)

Works with GitHub Apps

Deprecation Notice: This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new List reactions for a team discussion endpoint.

List the reactions to a team discussion. OAuth access tokens require the read:discussion scope.

パラメータ

Headers
名前, 種類, 説明
acceptstring

Setting to application/vnd.github.v3+json is recommended.

プレビューの通知を見る
Path parameters
名前, 種類, 説明
team_idinteger必� �

The unique identifier of the team.

discussion_numberinteger必� �

The number that identifies the discussion.

クエリパラメータ
名前, 種類, 説明
contentstring

Returns a single reaction type. Omit this parameter to list all reactions to a team discussion.

Can be one of: +1, -1, laugh, confused, heart, hooray, rocket, eyes

per_pageinteger

The number of results per page (max 100).

デフォルト: 30

pageinteger

Page number of the results to fetch.

デフォルト: 1

HTTP response status codes

Status code説明
200

OK

コードサンプル

get/teams/{team_id}/discussions/{discussion_number}/reactions
curl \ -H "Accept: application/vnd.github.v3+json" \ -H "Authorization: token <TOKEN>" \ http(s)://HOSTNAME/api/v3/teams/TEAM_ID/discussions/DISCUSSION_NUMBER/reactions

Response

Status: 200
[ { "id": 1, "node_id": "MDg6UmVhY3Rpb24x", "user": { "login": "octocat", "id": 1, "node_id": "MDQ6VXNlcjE=", "avatar_url": "https://github.com/images/error/octocat_happy.gif", "gravatar_id": "", "url": "https://api.github.com/users/octocat", "html_url": "https://github.com/octocat", "followers_url": "https://api.github.com/users/octocat/followers", "following_url": "https://api.github.com/users/octocat/following{/other_user}", "gists_url": "https://api.github.com/users/octocat/gists{/gist_id}", "starred_url": "https://api.github.com/users/octocat/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/octocat/subscriptions", "organizations_url": "https://api.github.com/users/octocat/orgs", "repos_url": "https://api.github.com/users/octocat/repos", "events_url": "https://api.github.com/users/octocat/events{/privacy}", "received_events_url": "https://api.github.com/users/octocat/received_events", "type": "User", "site_admin": false }, "content": "heart", "created_at": "2016-05-20T20:09:31Z" } ]

プレビュー通知

An additional reactions object in the issue comment payload is currently available for developers to preview. During the preview period, the APIs may change without advance notice. Please see the blog post for full details.

To access the API you must provide a custom media type in the Accept header:

application/vnd.github.squirrel-girl-preview

The reactions key will have the following payload where url can be used to construct the API location for listing and creating reactions.

Create reaction for a team discussion (Legacy)

Deprecation Notice: This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new Create reaction for a team discussion endpoint.

Create a reaction to a team discussion. OAuth access tokens require the write:discussion scope. A response with an HTTP 200 status means that you already added the reaction type to this team discussion.

パラメータ

Headers
名前, 種類, 説明
acceptstring

Setting to application/vnd.github.v3+json is recommended.

プレビューの通知を見る
Path parameters
名前, 種類, 説明
team_idinteger必� �

The unique identifier of the team.

discussion_numberinteger必� �

The number that identifies the discussion.

Body parameters
名前, 種類, 説明
contentstring必� �

The reaction type to add to the team discussion.

Can be one of: +1, -1, laugh, confused, heart, hooray, rocket, eyes

HTTP response status codes

Status code説明
201

Created

コードサンプル

post/teams/{team_id}/discussions/{discussion_number}/reactions
curl \ -X POST \ -H "Accept: application/vnd.github.v3+json" \ -H "Authorization: token <TOKEN>" \ http(s)://HOSTNAME/api/v3/teams/TEAM_ID/discussions/DISCUSSION_NUMBER/reactions \ -d '{"content":"heart"}'

Response

Status: 201
{ "id": 1, "node_id": "MDg6UmVhY3Rpb24x", "user": { "login": "octocat", "id": 1, "node_id": "MDQ6VXNlcjE=", "avatar_url": "https://github.com/images/error/octocat_happy.gif", "gravatar_id": "", "url": "https://api.github.com/users/octocat", "html_url": "https://github.com/octocat", "followers_url": "https://api.github.com/users/octocat/followers", "following_url": "https://api.github.com/users/octocat/following{/other_user}", "gists_url": "https://api.github.com/users/octocat/gists{/gist_id}", "starred_url": "https://api.github.com/users/octocat/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/octocat/subscriptions", "organizations_url": "https://api.github.com/users/octocat/orgs", "repos_url": "https://api.github.com/users/octocat/repos", "events_url": "https://api.github.com/users/octocat/events{/privacy}", "received_events_url": "https://api.github.com/users/octocat/received_events", "type": "User", "site_admin": false }, "content": "heart", "created_at": "2016-05-20T20:09:31Z" }

プレビュー通知

An additional reactions object in the issue comment payload is currently available for developers to preview. During the preview period, the APIs may change without advance notice. Please see the blog post for full details.

To access the API you must provide a custom media type in the Accept header:

application/vnd.github.squirrel-girl-preview

The reactions key will have the following payload where url can be used to construct the API location for listing and creating reactions.