Github 问题可能会在很长一段时间内包含“ react ”(如此处所述:https://github.com/blog/2119-add-reactions-to-pull-requests-issues-and-comments)
我想使用 Github api 接收该信息,但在遇到问题时似乎没有类似的东西,例如
api.github.com/repos/twbs/bootstrap/issues/19575
该信息似乎不在该响应中。此外,我没有找到可以检索该信息的另一个 API 调用。如何得到这些“ react ”?
最佳答案
现在这是可能的,处于预览状态(这意味着您必须在请求中传递自定义 Accept
header )。查看 GitHub API documentation page
例子
$ 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"
}
]
端点如下所示:
GET /repos/:owner/:repo/issues/:number/reactions
您甚至可以通过
content
参数(查询字符串)指示您要检索的 react 类型。
关于github - 使用 Github api 获取 react ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36641368/