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

Next challenges

Recent achievements

  • Global
  • Personal

Recognition

  • Give kudos
  • Received
  • Given

Leaderboard

  • Global

Trophy case

Kudos (beta program)

Kudos logo

You've been invited into the Kudos (beta program) private group. Chat with others in the program, or give feedback to Atlassian.

View group

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Different API results on Bitbucket Server with same user Edited

Hello all -

Weird issues I'm seeing with Bitbucket Server v4.14.4.

I built a Python application that uses the Python Requests library for RESTful interaction. It works great and I can query Projects, Repositories, etc and get a nice .json file back.

Here is where it gets strange.

When using the Python application and my BB user/password I get say, 100 projects, from this server.

When I put in the exact URL 

<server>/rest/api/1.0/projects?limit=1000

I get about 60 more projects!

I dumped both results into excel and did a compare and via the Python Requests API query I see all the same projects but with a Chrome dump I see more projects.

My user has Admin access and can see all repos.

Really baffling in why Chrome is returning more data than a Python API call.

Any idea on what might be occurring? I see no rhyme or reason because the projects are scattered throughout the list.

 

Edit: So I queried these projects via the API and am getting this message back:

{ "errors": [{ "context": null, "message": "You are not permitted to access this resource", "exceptionName": "com.atlassian.bitbucket.AuthorisationException" }]}

So my user can see the projects, see the .json file, see the repos when using Chrome but when querying the exact same project from the CLI (using Python and basic REST commands) I am getting authentication errors.

How do you go about fixing user permissions so that a web user can see the same data as a CLI user? 

1 answer

0 votes

Hi! 

After reading the post I understood the problem with pagination 

Please, take a look how to fetch from paginated response in that module

https://github.com/atlassian-api/atlassian-python-api/tree/master/atlassian/bitbucket

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Posted in Bitbucket

Contest: Share your custom Bitbucket Pipe and win

Announced in this blog, this holiday season we’re celebrating all things CI/CD and between now and the end of 2019 we’ll be showcasing content, use cases, feature announcements and more. One featur...

2,140 views 11 6
Join discussion

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you