反应
反应 API 使您能够创建、列出和删除评论中的反应。
关于反应 API
您可以使用反应 API 创建和管理对评论的反应。 创建反应时,content 参数的允许值如下(带有相应的表情符号供参考):
| content | 表情符号 |
|---|---|
+1 |
👍 |
-1 |
👎 |
微笑 |
😄 |
困惑 |
😕 |
heart |
❤️ |
欢呼 |
🎉 |
火箭 |
🚀 |
眼睛 |
👀 |
List reactions for a team discussion comment
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.
参数
| 标头 |
|---|
| 名称, 类型, 描述 |
acceptstringSetting to |
| 路径参数 |
| 名称, 类型, 描述 |
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. |
| 查询参数 |
| 名称, 类型, 描述 |
contentstringReturns a single reaction type. Omit this parameter to list all reactions to a team discussion comment. 可以是以下其中之一: |
per_pageintegerThe number of results per page (max 100). 默认值: |
pageintegerPage number of the results to fetch. 默认值: |
HTTP 响应状态代码
| 状态代码 | 描述 |
|---|---|
200 | OK |
代码示例
curl \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer <YOUR-TOKEN>" \
https://api.github.com/orgs/ORG/teams/TEAM_SLUG/discussions/DISCUSSION_NUMBER/comments/COMMENT_NUMBER/reactionsResponse
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