Hello,
I need to get all the pullrequests that contain a certain commit by using the API.
In the documentation i found that "/2.0/repositories/{workspace}/{repo_slug}/commit/{commit}/pullrequests" could be used to get a list of all pull requests that contain a commit which I think is what i would need (https://developer.atlassian.com/bitbucket/api/2/reference/resource/repositories/%7Bworkspace%7D/%7Brepo_slug%7D/commit/%7Bcommit%7D/pullrequests)
When I try to use a get call (on bitbucket.org/!api/2.0/repositories/XtraSonic/<myrepo>/commit/<mycommit>/pullrequests) I get an error:
"message": "Resource not found",
"detail": "There is no API hosted at this URL.\n\nFor information about our API's, please refer to the documentation at: https://developer.atlassian.com/bitbucket/api/2/reference/"
If i delete the pullrequests at the end of the link, i do get the commit i am expecting.
Is the /pullrequests functionality no longer supported or am I missing something ?
Hello @XtraSonic,
You should use api.bitbucket.org instead of /!api to fetch this data. Note that session authentication is not allowed on that domain, you should authenticate with basic auth (regular or app password) or OAuth token. This should work:
https://api.bitbucket.org/2.0/repositories/XtraSonic/<repo_slug>/commit/<commit_hash>/pullrequests
Let me know if you have any questions.
Cheers,
Daniil
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.