Skip to main content
The REST API is now versioned. For more information, see "About API versioning."

反应

使用 REST API 与 GitHub 上的反应进行交互。

关于反应

你可以创建和管理对 GitHub 上的评论、问题、拉取请求和讨论的反应。 创建反应时,content 参数的允许值如下(对应的表情符号供参考):

内容 表情
+1 ????
-1 ????
laugh ????
confused ????
heart ❤️
hooray ????
rocket ????
eyes ????

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.

Parameters for "List reactions for a team discussion comment"

标头
名称, 类型, 说明
accept string

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

路径参数
名称, 类型, 说明
org string 必须

The organization name. The name is not case sensitive.

team_slug string 必须

The slug of the team name.

discussion_number integer 必须

The number that identifies the discussion.

comment_number integer 必须

The number that identifies the comment.

查询参数
名称, 类型, 说明
content string

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

可以是以下选项之一: +1, -1, laugh, confused, heart, hooray, rocket, eyes

per_page integer

The number of results per page (max 100).

默认: 30

page integer

Page number of the results to fetch.

默认: 1

HTTP response status codes for "List reactions for a team discussion comment"

Status codeDescription
200

OK

Code samples for "List reactions for a team discussion comment"

get/orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions
curl -L \ -H "Accept: application/vnd.github+json" \ -H "Authorization: Bearer <YOUR-TOKEN>" \ -H "X-GitHub-Api-Version: 2022-11-28" \ https://api.github.com/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" } ]

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.

Parameters for "Create reaction for a team discussion comment"

标头
名称, 类型, 说明
accept string

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

路径参数
名称, 类型, 说明
org string 必须

The organization name. The name is not case sensitive.

team_slug string 必须

The slug of the team name.

discussion_number integer 必须

The number that identifies the discussion.

comment_number integer 必须

The number that identifies the comment.

正文参数
名称, 类型, 说明
content string 必须

The reaction type to add to the team discussion comment.

可以是以下选项之一: +1, -1, laugh, confused, heart, hooray, rocket, eyes

HTTP response status codes for "Create reaction for a team discussion comment"

Status codeDescription
200

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

201

Created

Code samples for "Create reaction for a team discussion comment"

post/orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions
curl -L \ -X POST \ -H "Accept: application/vnd.github+json" \ -H "Authorization: Bearer <YOUR-TOKEN>" \ -H "X-GitHub-Api-Version: 2022-11-28" \ https://api.github.com/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" }

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.

Parameters for "Delete team discussion comment reaction"

标头
名称, 类型, 说明
accept string

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

路径参数
名称, 类型, 说明
org string 必须

The organization name. The name is not case sensitive.

team_slug string 必须

The slug of the team name.

discussion_number integer 必须

The number that identifies the discussion.

comment_number integer 必须

The number that identifies the comment.

reaction_id integer 必须

The unique identifier of the reaction.

HTTP response status codes for "Delete team discussion comment reaction"

Status codeDescription
204

No Content

Code samples for "Delete team discussion comment reaction"

delete/orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions/{reaction_id}
curl -L \ -X DELETE \ -H "Accept: application/vnd.github+json" \ -H "Authorization: Bearer <YOUR-TOKEN>" \ -H "X-GitHub-Api-Version: 2022-11-28" \ https://api.github.com/orgs/ORG/teams/TEAM_SLUG/discussions/DISCUSSION_NUMBER/comments/COMMENT_NUMBER/reactions/REACTION_ID

Response

Status: 204

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.

Parameters for "List reactions for a team discussion"

标头
名称, 类型, 说明
accept string

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

路径参数
名称, 类型, 说明
org string 必须

The organization name. The name is not case sensitive.

team_slug string 必须

The slug of the team name.

discussion_number integer 必须

The number that identifies the discussion.

查询参数
名称, 类型, 说明
content string

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

可以是以下选项之一: +1, -1, laugh, confused, heart, hooray, rocket, eyes

per_page integer

The number of results per page (max 100).

默认: 30

page integer

Page number of the results to fetch.

默认: 1

HTTP response status codes for "List reactions for a team discussion"

Status codeDescription
200

OK

Code samples for "List reactions for a team discussion"

get/orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions
curl -L \ -H "Accept: application/vnd.github+json" \ -H "Authorization: Bearer <YOUR-TOKEN>" \ -H "X-GitHub-Api-Version: 2022-11-28" \ https://api.github.com/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" } ]

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.

Parameters for "Create reaction for a team discussion"

标头
名称, 类型, 说明
accept string

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

路径参数
名称, 类型, 说明
org string 必须

The organization name. The name is not case sensitive.

team_slug string 必须

The slug of the team name.

discussion_number integer 必须

The number that identifies the discussion.

正文参数
名称, 类型, 说明
content string 必须

The reaction type to add to the team discussion.

可以是以下选项之一: +1, -1, laugh, confused, heart, hooray, rocket, eyes

HTTP response status codes for "Create reaction for a team discussion"

Status codeDescription
200

OK

201

Created

Code samples for "Create reaction for a team discussion"

post/orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions
curl -L \ -X POST \ -H "Accept: application/vnd.github+json" \ -H "Authorization: Bearer <YOUR-TOKEN>" \ -H "X-GitHub-Api-Version: 2022-11-28" \ https://api.github.com/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" }

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.

Parameters for "Delete team discussion reaction"

标头
名称, 类型, 说明
accept string

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

路径参数
名称, 类型, 说明
org string 必须

The organization name. The name is not case sensitive.

team_slug string 必须

The slug of the team name.

discussion_number integer 必须

The number that identifies the discussion.

reaction_id integer 必须

The unique identifier of the reaction.

HTTP response status codes for "Delete team discussion reaction"

Status codeDescription
204

No Content

Code samples for "Delete team discussion reaction"

delete/orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions/{reaction_id}
curl -L \ -X DELETE \ -H "Accept: application/vnd.github+json" \ -H "Authorization: Bearer <YOUR-TOKEN>" \ -H "X-GitHub-Api-Version: 2022-11-28" \ https://api.github.com/orgs/ORG/teams/TEAM_SLUG/discussions/DISCUSSION_NUMBER/reactions/REACTION_ID

Response

Status: 204

List reactions for a commit comment

Works with GitHub Apps

List the reactions to a commit comment.

Parameters for "List reactions for a commit comment"

标头
名称, 类型, 说明
accept string

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

路径参数
名称, 类型, 说明
owner string 必须

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

repo string 必须

The name of the repository without the .git extension. The name is not case sensitive.

comment_id integer 必须

The unique identifier of the comment.

查询参数
名称, 类型, 说明
content string

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

可以是以下选项之一: +1, -1, laugh, confused, heart, hooray, rocket, eyes

per_page integer

The number of results per page (max 100).

默认: 30

page integer

Page number of the results to fetch.

默认: 1

HTTP response status codes for "List reactions for a commit comment"

Status codeDescription
200

OK

404

Resource not found

Code samples for "List reactions for a commit comment"

get/repos/{owner}/{repo}/comments/{comment_id}/reactions
curl -L \ -H "Accept: application/vnd.github+json" \ -H "Authorization: Bearer <YOUR-TOKEN>" \ -H "X-GitHub-Api-Version: 2022-11-28" \ https://api.github.com/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" } ]

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.

Parameters for "Create reaction for a commit comment"

标头
名称, 类型, 说明
accept string

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

路径参数
名称, 类型, 说明
owner string 必须

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

repo string 必须

The name of the repository without the .git extension. The name is not case sensitive.

comment_id integer 必须

The unique identifier of the comment.

正文参数
名称, 类型, 说明
content string 必须

The reaction type to add to the commit comment.

可以是以下选项之一: +1, -1, laugh, confused, heart, hooray, rocket, eyes

HTTP response status codes for "Create reaction for a commit comment"

Status codeDescription
200

Reaction exists

201

Reaction created

422

Validation failed, or the endpoint has been spammed.

Code samples for "Create reaction for a commit comment"

post/repos/{owner}/{repo}/comments/{comment_id}/reactions
curl -L \ -X POST \ -H "Accept: application/vnd.github+json" \ -H "Authorization: Bearer <YOUR-TOKEN>" \ -H "X-GitHub-Api-Version: 2022-11-28" \ https://api.github.com/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" }

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.

Parameters for "Delete a commit comment reaction"

标头
名称, 类型, 说明
accept string

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

路径参数
名称, 类型, 说明
owner string 必须

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

repo string 必须

The name of the repository without the .git extension. The name is not case sensitive.

comment_id integer 必须

The unique identifier of the comment.

reaction_id integer 必须

The unique identifier of the reaction.

HTTP response status codes for "Delete a commit comment reaction"

Status codeDescription
204

No Content

Code samples for "Delete a commit comment reaction"

delete/repos/{owner}/{repo}/comments/{comment_id}/reactions/{reaction_id}
curl -L \ -X DELETE \ -H "Accept: application/vnd.github+json" \ -H "Authorization: Bearer <YOUR-TOKEN>" \ -H "X-GitHub-Api-Version: 2022-11-28" \ https://api.github.com/repos/OWNER/REPO/comments/COMMENT_ID/reactions/REACTION_ID

Response

Status: 204

List reactions for an issue comment

Works with GitHub Apps

List the reactions to an issue comment.

Parameters for "List reactions for an issue comment"

标头
名称, 类型, 说明
accept string

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

路径参数
名称, 类型, 说明
owner string 必须

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

repo string 必须

The name of the repository without the .git extension. The name is not case sensitive.

comment_id integer 必须

The unique identifier of the comment.

查询参数
名称, 类型, 说明
content string

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

可以是以下选项之一: +1, -1, laugh, confused, heart, hooray, rocket, eyes

per_page integer

The number of results per page (max 100).

默认: 30

page integer

Page number of the results to fetch.

默认: 1

HTTP response status codes for "List reactions for an issue comment"

Status codeDescription
200

OK

404

Resource not found

Code samples for "List reactions for an issue comment"

get/repos/{owner}/{repo}/issues/comments/{comment_id}/reactions
curl -L \ -H "Accept: application/vnd.github+json" \ -H "Authorization: Bearer <YOUR-TOKEN>" \ -H "X-GitHub-Api-Version: 2022-11-28" \ https://api.github.com/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" } ]

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.

Parameters for "Create reaction for an issue comment"

标头
名称, 类型, 说明
accept string

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

路径参数
名称, 类型, 说明
owner string 必须

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

repo string 必须

The name of the repository without the .git extension. The name is not case sensitive.

comment_id integer 必须

The unique identifier of the comment.

正文参数
名称, 类型, 说明
content string 必须

The reaction type to add to the issue comment.

可以是以下选项之一: +1, -1, laugh, confused, heart, hooray, rocket, eyes

HTTP response status codes for "Create reaction for an issue comment"

Status codeDescription
200

Reaction exists

201

Reaction created

422

Validation failed, or the endpoint has been spammed.

Code samples for "Create reaction for an issue comment"

post/repos/{owner}/{repo}/issues/comments/{comment_id}/reactions
curl -L \ -X POST \ -H "Accept: application/vnd.github+json" \ -H "Authorization: Bearer <YOUR-TOKEN>" \ -H "X-GitHub-Api-Version: 2022-11-28" \ https://api.github.com/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" }

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.

Parameters for "Delete an issue comment reaction"

标头
名称, 类型, 说明
accept string

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

路径参数
名称, 类型, 说明
owner string 必须

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

repo string 必须

The name of the repository without the .git extension. The name is not case sensitive.

comment_id integer 必须

The unique identifier of the comment.

reaction_id integer 必须

The unique identifier of the reaction.

HTTP response status codes for "Delete an issue comment reaction"

Status codeDescription
204

No Content

Code samples for "Delete an issue comment reaction"

delete/repos/{owner}/{repo}/issues/comments/{comment_id}/reactions/{reaction_id}
curl -L \ -X DELETE \ -H "Accept: application/vnd.github+json" \ -H "Authorization: Bearer <YOUR-TOKEN>" \ -H "X-GitHub-Api-Version: 2022-11-28" \ https://api.github.com/repos/OWNER/REPO/issues/comments/COMMENT_ID/reactions/REACTION_ID

Response

Status: 204

List reactions for an issue

Works with GitHub Apps

List the reactions to an issue.

Parameters for "List reactions for an issue"

标头
名称, 类型, 说明
accept string

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

路径参数
名称, 类型, 说明
owner string 必须

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

repo string 必须

The name of the repository without the .git extension. The name is not case sensitive.

issue_number integer 必须

The number that identifies the issue.

查询参数
名称, 类型, 说明
content string

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

可以是以下选项之一: +1, -1, laugh, confused, heart, hooray, rocket, eyes

per_page integer

The number of results per page (max 100).

默认: 30

page integer

Page number of the results to fetch.

默认: 1

HTTP response status codes for "List reactions for an issue"

Status codeDescription
200

OK

404

Resource not found

410

Gone

Code samples for "List reactions for an issue"

get/repos/{owner}/{repo}/issues/{issue_number}/reactions
curl -L \ -H "Accept: application/vnd.github+json" \ -H "Authorization: Bearer <YOUR-TOKEN>" \ -H "X-GitHub-Api-Version: 2022-11-28" \ https://api.github.com/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" } ]

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.

Parameters for "Create reaction for an issue"

标头
名称, 类型, 说明
accept string

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

路径参数
名称, 类型, 说明
owner string 必须

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

repo string 必须

The name of the repository without the .git extension. The name is not case sensitive.

issue_number integer 必须

The number that identifies the issue.

正文参数
名称, 类型, 说明
content string 必须

The reaction type to add to the issue.

可以是以下选项之一: +1, -1, laugh, confused, heart, hooray, rocket, eyes

HTTP response status codes for "Create reaction for an issue"

Status codeDescription
200

OK

201

Created

422

Validation failed, or the endpoint has been spammed.

Code samples for "Create reaction for an issue"

post/repos/{owner}/{repo}/issues/{issue_number}/reactions
curl -L \ -X POST \ -H "Accept: application/vnd.github+json" \ -H "Authorization: Bearer <YOUR-TOKEN>" \ -H "X-GitHub-Api-Version: 2022-11-28" \ https://api.github.com/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" }

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.

Parameters for "Delete an issue reaction"

标头
名称, 类型, 说明
accept string

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

路径参数
名称, 类型, 说明
owner string 必须

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

repo string 必须

The name of the repository without the .git extension. The name is not case sensitive.

issue_number integer 必须

The number that identifies the issue.

reaction_id integer 必须

The unique identifier of the reaction.

HTTP response status codes for "Delete an issue reaction"

Status codeDescription
204

No Content

Code samples for "Delete an issue reaction"

delete/repos/{owner}/{repo}/issues/{issue_number}/reactions/{reaction_id}
curl -L \ -X DELETE \ -H "Accept: application/vnd.github+json" \ -H "Authorization: Bearer <YOUR-TOKEN>" \ -H "X-GitHub-Api-Version: 2022-11-28" \ https://api.github.com/repos/OWNER/REPO/issues/ISSUE_NUMBER/reactions/REACTION_ID

Response

Status: 204

List reactions for a pull request review comment

Works with GitHub Apps

List the reactions to a pull request review comment.

Parameters for "List reactions for a pull request review comment"

标头
名称, 类型, 说明
accept string

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

路径参数
名称, 类型, 说明
owner string 必须

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

repo string 必须

The name of the repository without the .git extension. The name is not case sensitive.

comment_id integer 必须

The unique identifier of the comment.

查询参数
名称, 类型, 说明
content string

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

可以是以下选项之一: +1, -1, laugh, confused, heart, hooray, rocket, eyes

per_page integer

The number of results per page (max 100).

默认: 30

page integer

Page number of the results to fetch.

默认: 1

HTTP response status codes for "List reactions for a pull request review comment"

Status codeDescription
200

OK

404

Resource not found

Code samples for "List reactions for a pull request review comment"

get/repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions
curl -L \ -H "Accept: application/vnd.github+json" \ -H "Authorization: Bearer <YOUR-TOKEN>" \ -H "X-GitHub-Api-Version: 2022-11-28" \ https://api.github.com/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" } ]

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.

Parameters for "Create reaction for a pull request review comment"

标头
名称, 类型, 说明
accept string

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

路径参数
名称, 类型, 说明
owner string 必须

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

repo string 必须

The name of the repository without the .git extension. The name is not case sensitive.

comment_id integer 必须

The unique identifier of the comment.

正文参数
名称, 类型, 说明
content string 必须

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

可以是以下选项之一: +1, -1, laugh, confused, heart, hooray, rocket, eyes

HTTP response status codes for "Create reaction for a pull request review comment"

Status codeDescription
200

Reaction exists

201

Reaction created

422

Validation failed, or the endpoint has been spammed.

Code samples for "Create reaction for a pull request review comment"

post/repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions
curl -L \ -X POST \ -H "Accept: application/vnd.github+json" \ -H "Authorization: Bearer <YOUR-TOKEN>" \ -H "X-GitHub-Api-Version: 2022-11-28" \ https://api.github.com/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" }

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.

Parameters for "Delete a pull request comment reaction"

标头
名称, 类型, 说明
accept string

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

路径参数
名称, 类型, 说明
owner string 必须

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

repo string 必须

The name of the repository without the .git extension. The name is not case sensitive.

comment_id integer 必须

The unique identifier of the comment.

reaction_id integer 必须

The unique identifier of the reaction.

HTTP response status codes for "Delete a pull request comment reaction"

Status codeDescription
204

No Content

Code samples for "Delete a pull request comment reaction"

delete/repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions/{reaction_id}
curl -L \ -X DELETE \ -H "Accept: application/vnd.github+json" \ -H "Authorization: Bearer <YOUR-TOKEN>" \ -H "X-GitHub-Api-Version: 2022-11-28" \ https://api.github.com/repos/OWNER/REPO/pulls/comments/COMMENT_ID/reactions/REACTION_ID

Response

Status: 204

List reactions for a release

Works with GitHub Apps

List the reactions to a release.

Parameters for "List reactions for a release"

标头
名称, 类型, 说明
accept string

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

路径参数
名称, 类型, 说明
owner string 必须

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

repo string 必须

The name of the repository without the .git extension. The name is not case sensitive.

release_id integer 必须

The unique identifier of the release.

查询参数
名称, 类型, 说明
content string

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

可以是以下选项之一: +1, laugh, heart, hooray, rocket, eyes

per_page integer

The number of results per page (max 100).

默认: 30

page integer

Page number of the results to fetch.

默认: 1

HTTP response status codes for "List reactions for a release"

Status codeDescription
200

OK

404

Resource not found

Code samples for "List reactions for a release"

get/repos/{owner}/{repo}/releases/{release_id}/reactions
curl -L \ -H "Accept: application/vnd.github+json" \ -H "Authorization: Bearer <YOUR-TOKEN>" \ -H "X-GitHub-Api-Version: 2022-11-28" \ https://api.github.com/repos/OWNER/REPO/releases/RELEASE_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" } ]

Create reaction for a release

Works with GitHub Apps

Create a reaction to a release. A response with a Status: 200 OK means that you already added the reaction type to this release.

Parameters for "Create reaction for a release"

标头
名称, 类型, 说明
accept string

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

路径参数
名称, 类型, 说明
owner string 必须

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

repo string 必须

The name of the repository without the .git extension. The name is not case sensitive.

release_id integer 必须

The unique identifier of the release.

正文参数
名称, 类型, 说明
content string 必须

The reaction type to add to the release.

可以是以下选项之一: +1, laugh, heart, hooray, rocket, eyes

HTTP response status codes for "Create reaction for a release"

Status codeDescription
200

Reaction exists

201

Reaction created

422

Validation failed, or the endpoint has been spammed.

Code samples for "Create reaction for a release"

post/repos/{owner}/{repo}/releases/{release_id}/reactions
curl -L \ -X POST \ -H "Accept: application/vnd.github+json" \ -H "Authorization: Bearer <YOUR-TOKEN>" \ -H "X-GitHub-Api-Version: 2022-11-28" \ https://api.github.com/repos/OWNER/REPO/releases/RELEASE_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" }

Delete a release reaction

Works with GitHub Apps

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

Delete a reaction to a release.

Parameters for "Delete a release reaction"

标头
名称, 类型, 说明
accept string

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

路径参数
名称, 类型, 说明
owner string 必须

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

repo string 必须

The name of the repository without the .git extension. The name is not case sensitive.

release_id integer 必须

The unique identifier of the release.

reaction_id integer 必须

The unique identifier of the reaction.

HTTP response status codes for "Delete a release reaction"

Status codeDescription
204

No Content

Code samples for "Delete a release reaction"

delete/repos/{owner}/{repo}/releases/{release_id}/reactions/{reaction_id}
curl -L \ -X DELETE \ -H "Accept: application/vnd.github+json" \ -H "Authorization: Bearer <YOUR-TOKEN>" \ -H "X-GitHub-Api-Version: 2022-11-28" \ https://api.github.com/repos/OWNER/REPO/releases/RELEASE_ID/reactions/REACTION_ID

Response

Status: 204

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.

Parameters for "List reactions for a team discussion comment (Legacy)"

标头
名称, 类型, 说明
accept string

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

路径参数
名称, 类型, 说明
team_id integer 必须

The unique identifier of the team.

discussion_number integer 必须

The number that identifies the discussion.

comment_number integer 必须

The number that identifies the comment.

查询参数
名称, 类型, 说明
content string

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

可以是以下选项之一: +1, -1, laugh, confused, heart, hooray, rocket, eyes

per_page integer

The number of results per page (max 100).

默认: 30

page integer

Page number of the results to fetch.

默认: 1

HTTP response status codes for "List reactions for a team discussion comment (Legacy)"

Status codeDescription
200

OK

Code samples for "List reactions for a team discussion comment (Legacy)"

get/teams/{team_id}/discussions/{discussion_number}/comments/{comment_number}/reactions
curl -L \ -H "Accept: application/vnd.github+json" \ -H "Authorization: Bearer <YOUR-TOKEN>" \ -H "X-GitHub-Api-Version: 2022-11-28" \ https://api.github.com/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" } ]

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.

Parameters for "Create reaction for a team discussion comment (Legacy)"

标头
名称, 类型, 说明
accept string

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

路径参数
名称, 类型, 说明
team_id integer 必须

The unique identifier of the team.

discussion_number integer 必须

The number that identifies the discussion.

comment_number integer 必须

The number that identifies the comment.

正文参数
名称, 类型, 说明
content string 必须

The reaction type to add to the team discussion comment.

可以是以下选项之一: +1, -1, laugh, confused, heart, hooray, rocket, eyes

HTTP response status codes for "Create reaction for a team discussion comment (Legacy)"

Status codeDescription
201

Created

Code samples for "Create reaction for a team discussion comment (Legacy)"

post/teams/{team_id}/discussions/{discussion_number}/comments/{comment_number}/reactions
curl -L \ -X POST \ -H "Accept: application/vnd.github+json" \ -H "Authorization: Bearer <YOUR-TOKEN>" \ -H "X-GitHub-Api-Version: 2022-11-28" \ https://api.github.com/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" }

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.

Parameters for "List reactions for a team discussion (Legacy)"

标头
名称, 类型, 说明
accept string

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

路径参数
名称, 类型, 说明
team_id integer 必须

The unique identifier of the team.

discussion_number integer 必须

The number that identifies the discussion.

查询参数
名称, 类型, 说明
content string

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

可以是以下选项之一: +1, -1, laugh, confused, heart, hooray, rocket, eyes

per_page integer

The number of results per page (max 100).

默认: 30

page integer

Page number of the results to fetch.

默认: 1

HTTP response status codes for "List reactions for a team discussion (Legacy)"

Status codeDescription
200

OK

Code samples for "List reactions for a team discussion (Legacy)"

get/teams/{team_id}/discussions/{discussion_number}/reactions
curl -L \ -H "Accept: application/vnd.github+json" \ -H "Authorization: Bearer <YOUR-TOKEN>" \ -H "X-GitHub-Api-Version: 2022-11-28" \ https://api.github.com/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" } ]

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.

Parameters for "Create reaction for a team discussion (Legacy)"

标头
名称, 类型, 说明
accept string

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

路径参数
名称, 类型, 说明
team_id integer 必须

The unique identifier of the team.

discussion_number integer 必须

The number that identifies the discussion.

正文参数
名称, 类型, 说明
content string 必须

The reaction type to add to the team discussion.

可以是以下选项之一: +1, -1, laugh, confused, heart, hooray, rocket, eyes

HTTP response status codes for "Create reaction for a team discussion (Legacy)"

Status codeDescription
201

Created

Code samples for "Create reaction for a team discussion (Legacy)"

post/teams/{team_id}/discussions/{discussion_number}/reactions
curl -L \ -X POST \ -H "Accept: application/vnd.github+json" \ -H "Authorization: Bearer <YOUR-TOKEN>" \ -H "X-GitHub-Api-Version: 2022-11-28" \ https://api.github.com/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" }