BitBucket 1.0 REST API Retrieve all Pull-Requests for repository

Jon Erickson picture Jon Erickson · Oct 11, 2017 · Viewed 8.7k times · Source

When I curl the rest api, I get back an empty response but I know that there are pull-requests open.

What is the setting in bitbucket stash that allows anyone to view/read pull-requests without being authenticated?

curl -X GET https://bitbucket/rest/api/1.0/projects/{project}/repos/{repo}/pull-requests

response:

{
    "size": 0,
    "limit": 25,
    "isLastPage": true,
    "values": [],
    "start": 0
}

Answer

Michael Krolak picture Michael Krolak · Oct 25, 2017

Try

curl -X GET https://bitbucket/rest/api/1.0/projects/{project}/repos/{repo}/pull-requests?state=ALL

You can find more options for this specific API call at https://developer.atlassian.com/static/rest/bitbucket-server/latest/bitbucket-rest.html#idm140236731714560