Hi,
I'm trying to get list of all ours repositories via REST API
https://api.bitbucket.org/2.0/repositories/workspace_id where workspace_id = our valid workspaceId ... we received HTTP 200 but in response body is only:
{"values": [], "pagelen": 10, "size": 0, "page": 1}
even we have many repositories and user used for REST auth. has permition for all those repositories.
Hi Lukas and welcome to the community!
The 200 response indicates that the authentication details are valid, but the fact that you get no data usually means that the authenticated user or access token doesn't have permissions to get the repos.
What type of authentication do you use for this API call? Do you use the username and app password of a user, or do you use an access token (if so, what type of access token is it, repository, project, workspace, or oauth access token)?
If you use username and app password, are they credentials of your own Bitbcuket account or of another user? If you use a different user for authentication, does the call work if you authenticate with your own user, as follows:
curl -v -u username:app_password --request GET \--url 'https://api.bitbucket.org/2.0/repositories/workspace-id' \--header 'Accept: application/json'
I'm just asking to better understand the scope of the problem.
If you execute the problematic call again and you give me the date and time (in UTC) that you did this, I can also check our API logs for the authenticated user and the logs may shed some more light on what is happening.
Kind regards,Theodora
Hi Theodora,
I'm using my account which has ADMIN right and should have permission to all our repos. So I use userName and app password.
I've just tried it with same result ... 20.3.2025 8:10 CET .. but Time in response header is different ... I guess you have some cache on your side..
If it helps here are some data from response:
date: Thu, 20 Mar 2025 06:59:37 GMTserver: AtlassianEdgevary: Authorization, Origin, Accept-Encodingx-view-name: bitbucket.apps.repo2.api.v20.repo.RepositoriesHandlerx-used-mesh: Falsex-dc-location: Micros-3x-served-by: 750407edb127x-version: ff05a03a9359x-static-version: ff05a03a9359x-request-count: 1273x-render-time: 0.0605311393737793x-b3-traceid: c610b44815534fb08cb2a1b65f302b0ax-b3-spanid: e6b531e88896dc90x-usage-user-time: 0.037834x-usage-system-time: 0.000000x-usage-input-ops: 0x-usage-output-ops: 0atl-traceid: c610b44815534fb08cb2a1b65f302b0aatl-request-id: c610b448-1553-4fb0-8cb2-a1b65f302b0ax-trace-id: c610b44815534fb08cb2a1b65f302b0areport-to: {"endpoints": [{"url": "https://dz8aopenkvv6s.cloudfront.net"}], "group": "endpoint-1", "include_subdomains": true, "max_age": 600}nel: {"failure_fraction": 0.001, "include_subdomains": true, "max_age": 600, "report_to": "endpoint-1"}server-timing: atl-edge;dur=171,atl-edge-internal;dur=4,atl-edge-upstream;dur=168,atl-edge-pop;desc="aws-eu-central-1"content-type: application/json; charset=utf-8content-length: 51x-accepted-oauth-scopes: repositoryetag: "9ef7a6f96b3f98d05691462d9b5feda5"x-frame-options: SAMEORIGINcache-control: max-age=900x-content-type-options: nosniffx-xss-protection: 1; mode=block
Thank you for trying to help me
Lukas
Hi again ...
I also tried different access ... I created OAuth Consumer with read rights and get access_token ... but request for repository list is the same ... only empty lis
date: Fri, 21 Mar 2025 10:30:14 GMT - 11:30:14 CETserver: AtlassianEdgevary: Authorization, Origin, Accept-Encodingx-view-name: bitbucket.apps.repo2.api.v20.repo.RepositoriesHandlerx-used-mesh: Falsex-dc-location: Micros-3x-served-by: 1d20aca91c5fx-version: ff05a03a9359x-static-version: ff05a03a9359x-request-count: 3432x-render-time: 0.05171990394592285x-b3-traceid: 8ba8c0dcc4924e18bd41dfd7a85e180ex-b3-spanid: 1a5bb6f7583c9680x-usage-user-time: 0.035563x-usage-system-time: 0.000909x-usage-input-ops: 0x-usage-output-ops: 0atl-traceid: 8ba8c0dcc4924e18bd41dfd7a85e180eatl-request-id: 8ba8c0dc-c492-4e18-bd41-dfd7a85e180e
I'd be happy for any idea why this isn't working.
Kind Regards
Hi Lukas,
Thank you for the info. I was able to find these API calls in our logs based on the trace id.
I can see that both calls try to get the repos of the workspace you are an admin of. However, I don't see any authentication details and I also can't see what kind of client you are using. The status code of both calls is 304.
It looks like you're new here. Sign in or register to get started.