So after lots of googling and reading through the Github API docs I figured it out. What i needed for this was the Github Search API. The first thing i did was figure out what endpoints where available to me on my enterprise API as described in this stackoverflow post. So I used the following command to do that:
curl -H "Authorization: token [myToken]" "https://github.mydomain.com/api/v3/"
One of the endpoints returned in the response was:
"issue_search_url": "https://github.mydomain.com/api/v3/search/issues?q={query}{&page,per_page,sort,order}"
Using that endpoint, I constructed the following command that gave me what I needed:
curl -H "Authorization: token [myToken]" "https://github.mydomain.com/api/v3/search/issues?page=1&per_page=100&sort=created&order=asc&q=repo:[Owner]/[RepoName]+is:issue+created:>=2015-09-01"
Let's break down the parameters (anything after the ? sign):
page=1&per_page=100
: The default number of results for this request is 30 per page. In my case I had 664 results. So I needed to do multiple request specifying which page (page=1
) and how many results I wanted for that request (per_page=100
) until i got all of them. In my case i did 7 request with the above url each time changing the page number. For more info see the Github docs on Pagination
&sort=created&order=asc
: Sor by the created date in ascending order (oldest first). See Github Search API and Searching Issues
q=repo:[Owner]/[RepoName]+is:issue+created:>=2015-09-01
: Form a search query (q=
) that limits the search to issues (is:issue
) created from 2015-09-01 and on (created:>=2015-09-01
) in the repo Owner/Name (repo:[Owner]/[RepoName]
)
Hope this helps others as I have found that the Github api docs are not very clear.