Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Get Reactions using the Github api

Github issues may contain "reactions" for quite a while (as described here: https://github.com/blog/2119-add-reactions-to-pull-requests-issues-and-comments)

enter image description here

I would like to receive that information using the Github api, but there doesn't seem to be anything like that when getting an issue e.g.

api.github.com/repos/twbs/bootstrap/issues/19575

that information does not seem to be inside that response. Also, I did not find another API call that could retrieve that information. How to get those "reactions"?

like image 524
Ole Albers Avatar asked Sep 08 '25 05:09

Ole Albers


1 Answers

This is now possible, being the preview state (meaning, you have to pass a custom Accept header in the request). Check out the GitHub API documentation page

Example

$ curl -H 'Accept: application/vnd.github.squirrel-girl-preview' https://api.github.com/repos/twbs/bootstrap/issues/19575/reactions
[
  {
    "id": 257024,
    "user_id": 947110,
    "content": "+1"
  },
  ...
  {
    "id": 888868,
    "user_id": 1889800,
    "content": "+1"
  }
]

The endpoint looks like this:

GET /repos/:owner/:repo/issues/:number/reactions

You can even pass a content parameter (querystring) indicating what kind of reaction you want to retrieve.

like image 95
Ionică Bizău Avatar answered Sep 10 '25 01:09

Ionică Bizău