I am attempting to use the legacy v1 endpoint
GET https://api.bitbucket.org/1.0/groups/{workspace}/{group_slug}
with the new api token auth method but it does not work. It says:
162{"type": "error", "error": {"message": "You do not have access to view this workspace."}}
I run this call:
curl --request GET \
--url 'https://api.bitbucket.org/1.0/groups/{workspace}/{group_slug}' \
--user '{atlassian_account_email}:{api_token}' \
--header 'Accept: application/json'
calls like https://api.bitbucket.org/2.0/user and https://api.bitbucket.org/2.0/workspaces/<workspace> work correctly so im wondering if it has to do with the /groups being legacy 1.0. To my knowledge the specific endpoint that I am using does not have a 2.0 version.
These are the permissions I have on the service account:
Hi Noor,
API Tokens work fine when I've executed these against the /1.0/groups endpoint with the following scope:
Here's my command:
curl --request GET \
--url 'https://api.bitbucket.org/1.0/groups/workspaceID/groupslug' \
--user useremail:APIToken
Do you have workspace admin privileges for the workspace you're attempting to query? If not, this call will fail as your actual user account privileges take precedence over the permissions scopes you have configured.
Cheers!
- Ben (Bitbucket Cloud Support)
Hi Ben, the account used is a service account. I ran 'https://api.bitbucket.org/2.0/user/permissions/workspaces' curl and got back that it has "permission": "member". Could that be the issue? does it need to be bumped up to collaborator or owner?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Noor Ahmadi
Correct - even if you have admin scope on the token, Bitbucket will first validate the actual user permissions of the user account tied to the token first to determine if the user account permissions oo the workspace match those of the token scope. This is to prevent privilege escalation attacks.
Cheers!
- Ben (Bitbucket Cloud Support)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.