Reações
A API de Reações permite que você crie, liste e exclua as reações nos comentários.
Sobre a API de reações
É possível criar e gerenciar reações em comentários usando a API de Reações. Ao criar uma reação, os valores permitidos para o parâmetro conteúdo são os seguintes (com o emoji correspondente para referência):
| conteúdo | emoji |
|---|---|
+1 |
👍 |
-1 |
👎 |
laugh |
😄 |
confused |
😕 |
coração |
❤️ |
hooray |
🎉 |
rocket |
🚀 |
eyes |
👀 |
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.
Parâmetros
| Headers |
|---|
| Nome, Tipo, Descrição |
acceptstringSetting to |
| Path parameters |
| Nome, Tipo, Descrição |
orgstringObrigatórioThe organization name. The name is not case sensitive. |
team_slugstringObrigatórioThe slug of the team name. |
discussion_numberintegerObrigatórioThe number that identifies the discussion. |
comment_numberintegerObrigatórioThe number that identifies the comment. |
| Parâmetros de consulta |
| Nome, Tipo, Descrição |
contentstringReturns a single reaction type. Omit this parameter to list all reactions to a team discussion comment. Pode ser uma das ações a seguir: |
per_pageintegerThe number of results per page (max 100). Padrão: |
pageintegerPage number of the results to fetch. Padrão: |
HTTP response status codes
| Status code | Descrição |
|---|---|
200 | OK |
Amostras de código
curl \
-H "Accept: application/vnd.github+json" \
-H "Authorization: token <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",
"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}",
"gis