Missed Team ’24? Catch up on announcements here.

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

Different API results on Bitbucket Server with same user

Allen March 19, 2018

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
Gonchik Tsymzhitov
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
January 28, 2021

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
AUG Leaders

Atlassian Community Events