Missed Team ’24? Catch up on announcements here.

×
Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Weired way of applying pagination, I don't see much on documentation as well

Hitendra Malviya
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
May 24, 2020

I would like to query all files exists in repository & apply pagination like below

https://api.bitbucket.org/2.0/repositories/{workspace}/{repo_slug}/src/{node}?pagelen=10&page=2

 

But it always gives me 500 internal server error.

1 answer

1 vote
Tyler T
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
May 26, 2020

Here is some information from the documentation: https://developer.atlassian.com/bitbucket/api/2/reference/meta/pagination

However, clients are not expected 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.

In your initial response (without the page parameter), you will find a URL to the next page of results.

Hitendra Malviya
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
May 27, 2020

Yes, I am able to see next page url in response but again new challenge is, I am not getting previous page url after I navigate to the next page. But document says paginated response will contain previous property if it can navigate to previous page? And somehow I am able to navigate to next page but unable to navigate to previous page, & I have to hack by keeping currentPage url in some variable.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events