github - 使用 Github api 获取 react

标签 github github-api

Github 问题可能会在很长一段时间内包含“ react ”(如此处所述:https://github.com/blog/2119-add-reactions-to-pull-requests-issues-and-comments)

enter image description here

我想使用 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/

相关文章:

git - 通过 Jenkins 标记 GitHub 项目

ruby-on-rails - 将代码从github转移到我自己的git服务器

python - 如何使用 GitHub API v3 创建提交并推送到 repo?

github-api - 使用 GitHub API 检索特定文件的所有版本

python - github代码搜索api总是返回404

node.js - 使用 Meteor 从 Github Assets API 下载文件时出错

github - Github.com 源代码是开源的吗?

git - 在不初始化 .gitignore 的情况下将现有项目添加到 Github

github - 如何找到与 heroku 应用程序关联的 github 存储库?

api - github v3 API - 删除/移除一个仓库