如何使用Github API与企业进行搜索

时间:2014-06-18 16:04:23

标签: github github-api

我正在尝试搜索存储库,但我似乎无法用github企业版来解决这个问题。我试过以下没有结果。有什么建议?

curl -i http://my.domain.com/api/v3/repositories "If-Modified-Since: Mon, 16 Jun 2014 01:01:01 CST"      

curl -i http://my.domain.com/api/v3/search/repos?q=pushed:2014-06-17 


HTTP/1.1 404 Not Found
Server: GitHub.com
Date: Wed, 18 Jun 2014 16:45:58 GMT
Content-Type: application/json; charset=utf-8
Connection: keep-alive
Status: 404 Not Found
X-GitHub-Media-Type: github.beta
X-Content-Type-Options: nosniff
Content-Length: 29
Access-Control-Allow-Credentials: true
Access-Control-Expose-Headers: ETag, Link, X-RateLimit-Limit, X-RateLimit-Remaining, X-    RateLimit-Res
et, X-OAuth-Scopes, X-Accepted-OAuth-Scopes
Access-Control-Allow-Origin: *
X-GitHub-Request-Id: b4eec0e7-1b1a-48b7-81d8-d63c28b55b37

{
  "message": "Not Found"
}

1 个答案:

答案 0 :(得分:8)

Github的公共和企业API的一个好处是,如果你去API根目录,它会告诉你哪些端点是可用的。在企业实例上,它是:http://my.domain.com/api/v3/。查看我公司的企业实例(抱歉不确定版本),我只看到legacy search API endpoints

因此:http://my.domain.com/api/v3/legacy/repos/search/pushed:2014-06-17可能是您想要的搜索网址。