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

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

How to search branches by name with pagination

I am using the next endpoint to search for the branches, GET /2.0/repositories/{workspace}/{repo_slug}/refs/branches.

Separately both the pagination and query searching work, but when combined an error is return. The error says "Invalid Page"

List Branches DOCS 

---

Steps to reproduce ( using the example from the DOCS )

1. The docs provide the next url as an example ( I have just updated the pagelen and page to return the first 10 results ): 

https://api.bitbucket.org/2.0/repositories/atlassian/aui/refs/branches?pagelen=10&page=1

2. If we add a query to search by name the error will be returned:

https://api.bitbucket.org/2.0/repositories/atlassian/aui/refs/branches?pagelen=10&page=1&q=name~"issue"

3. If we remove the `page` query parameter, the data will be returned:

https://api.bitbucket.org/2.0/repositories/atlassian/aui/refs/branches?pagelen=10&page=1&q=name~"issue"

---

So it looks like there is some issue with the "page" query parameter?
Or am I doing something wrong?

1 answer

0 votes
Erez Maadani
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
Mar 05, 2023

Hey @Milos Petrovic 

Try removing the `page` parameter from the request and use the returned URL from the `next` attribute in the response.

Hey @Erez Maadani

Yes this works!  Thanks

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events