Hi, I am currently calling the rest api to get a diff for pull requests. However, when I call the diff or difftstat on a PR it returns nothing. No error message just 0 bytes returned. Other calls such as list comments on the same PR work, and I've checked my permissions for the auth token.
Here is the call I am making to test; nothing is returned.
Hi @Andrew Hammerstone like you, i did struggle as well (although extremely late reply but hope can help someone who also get this issue) . If carefully reading document for list changes in a PR, this api in fact redirect to compare 2 commits. So the solution would only need to add -L option to allow curl command redirect, it would looks like this:
curl --request GET \
--url 'https://api.bitbucket.org/2.0/repositories/<project>/<repo>/pullrequests/25/diff' \
--header 'Authorization: Bearer '"$AUTH"'' \
-o output.json
G'day, @Andrew Hammerstone
Welcome to the community!
I believe the URL is incorrect, instead of the project it should be your workspace id for example my workspace name is bitbucket.org/abcd:
curl --request GET \
--url 'https://api.bitbucket.org/2.0/repositories/abcd/<reponame>/pullrequests/25/diff' \
--header 'Authorization: Bearer '"$AUTH"'' \
-o output.json
I hope this helps.
Regards,
Syahrul
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
That is what I am currently using I should have called it <workspace> over <project>.
The comments call works fine and returns data, the diff call returns 0 bytes.
'https://api.bitbucket.org/2.0/repositories/myspace/myrepo/pullrequests/40/diff'
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Can you share your request commands so I can quickly check them? You can replace them with <bracket> for sensitive information.
Regards,
Syahrul
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.