I tried using the page filter to this end point and it doesn't work:
curl --request GET \ --url 'https://api.bitbucket.org/2.0/repositories/{workspace}/{repo_slug}/pullrequests/{pull_request_id}/commits' \ --header 'Authorization: Bearer <access_token>'
Also the page filter doesn't work for this as well:
curl --request GET \ --url 'https://api.bitbucket.org/2.0/repositories/{workspace}/{repo_slug}/refs/tags' \ --header 'Authorization: Bearer <access_token>' \ --header 'Accept: application/json'
G'day @Akshara Anilkumar
I have tested the PR commit endpoint and have no issue getting the response. Example curl I used:
curl -X GET -u <username>:<appPassword> https://api.bitbucket.org/2.0/repositories/<WorkspaceID>/<RepoName>/pullrequests/<PRNumber>/commits
The same goes for the "/refs/tags" endpoint. I wonder if your authorization is incorrect. Could you try using the above example with the App Password and see if you succeeded?
Regards,
Syahrul
Hi @Syahrul
Yes that endpoint works but the issue is that the "page" filter doesn't work for those endpoints.
I am giving this endpoint: https://api.bitbucket.org/2.0/repositories/ck-mux-bitbucket-connector/bitbucket_repo/pullrequests/9/commits?page=1
Even for fetching the tags , its the same issue. The page filter doesn't work.
then the response is:
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Noted. Does your PR commits list have a next page if that's the case? Could you try fetching the information without the filter page parameter and scroll down to see if any second page exists?
Alternatively, you can use ?pagelen=100 to show the 100 objects in a single response.
Let me know how it goes.
Regards,
Syahrul
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Syahrul
Yes next page exist for PR commit. Currently that's how I am checking. This is just a feedback it would be great , if you could make the page filter work as things will be much easier to check the information.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Interesting. Have you tried adding ?pagelen=100 and see if that helps? I can't reproduce the behaviour, so I am curious to understand this issue further.
Regards,
Syahrul
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Syahrul
Yes it will work with the pagelen end point but what if we have more than 100 commits , then at that point we will have to search on basis of page number for which the page filter has to be used. I hope you understood the necessity of the end point.
Regards,
Akshara
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks for the update.
Upon further inspection, I found out that what you saw was an expected behaviour because. API clients are not likely to construct URLs themselves by manipulating the page number query parameter.
Instead, the response contains a link to the next page. This link should be treated as an opaque location that is not to be constructed by clients or even assumed to be predictable. The only contract around the next link is that it will return the next chunk of results.
Please check the following pagination to understand how our pagination works:
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.