Hi
I am using the following call:
(GET) https://api.bitbucket.org/2.0/repositories/{project}/{repo}/pullrequests/{pr_id}/comments?sort=-created_on
using the new API.
It only returns the latest 10 comments on the PR when rather I want to get them all.
On api 1.0 it did return all. And in the API docs there is no explanation for why only 10 comments.
Can anyone help please?
Thanks!
Hi @AlonKaganArgus
This endpoint is paginated, similarly to many other endpoints of 2.0 API. If you need to fetch all comments, you need to follow the links returned in the next property in the response.
You can increase the page size from the default 10 by adding pagelen query parameter to your request, however note that it is capped at 100, and any larger value would return an error.
Hope this helps.
Cheers,Daniil
It looks like you're new here. Sign in or register to get started.