Get list of comments from GitHub pull request
According to http://developer.github.com/v3/pulls/comments/#list-comments-on-a-pull-request
I should be able to get a list of comments by issuing the following curl statement, however, it is returning empty, as if there were no comments, any ideas why? or how I can get this to work?
curl "https://api.github.com/repos/37signals/sub/pulls/37/comments" -v
One Solution collect form web for “Get list of comments from GitHub pull request”
Notice the text near the top of the Pull requests API docs (under the TOC):
The Pull Request API allows you to list, view, edit, create, and even merge pull requests. Comments on pull requests can be managed via the Issue Comments API.
So, the API endpoint you are currently using is intended for Pull request review comments, not the normal Pull request comments:
Pull Request Review Comments are comments on a portion of the unified diff. These are separate from Commit Comments (which are applied directly to a commit, outside of the Pull Request view), and Issue Comments (which do not reference a portion of the unified diff).
Since the pull request you are referencing does not have any review comments, you are getting the correct result (an empty list). However, as I mentioned above, the API endpoint you should be hitting is the one for issue comments (just use the same pull request ID since it is equal to the issue ID):
curl "https://api.github.com/repos/37signals/sub/issues/37/comments" -v