I am attempting to use one of the APIs to get a list of users that are members of a specific group.
It appears the /groups endpoint was deprecated in 1.0, and is not available in 2.0 API get, but there is also mention at the below link that the group endpoints are still available (as do a number of other community conversations).
https://support.atlassian.com/bitbucket-cloud/docs/groups-endpoint/
Does this endpoint still exist?
How can I access it?
% curl -X 'GET' -H "Authorization: Bearer TOKEN" https://api.bitbucket.org/1.0/groups | jq
{
"type": "error",
"error": {
"message": "Token is invalid or not supported for this endpoint."
}
}
%
If it is a matter of permissions, where do those need to be set, as this token has full admin across all available resources for testing this.
Hello @alex ,
Thank you for reaching out to Atlassian Community!
The /1.0/groups endpoint is indeed still available until equivalent endpoints are still under the works for the 2.0 API.
From the error you shared, it seems like the access token you are using is either invalid or does not have the required scopes.
I was able to get the members of a group by making a request to the group's endpoint as in the following example:
curl -X GET https://api.bitbucket.org/1.0/groups/<workspace>/<groups>/members \
--header 'Authorization: Bearer ACCESS_TOKEN'
It's also possible to use Basic authentication by providing your bitbucket account username and an app password :
curl -u USERNAME:APP_PASSWORD -X GET https://api.bitbucket.org/1.0/groups/<workspace>/<group>/members
In this case, could you please confirm how exactly are you generating this access token? Is it by using an OAuth consumer ?
Thank you, @alex !
Patrik S
Thanks for the reply @Patrik S
We are generating the token on the Workspace Access Token page:
https://bitbucket.org/company/workspace/settings/access-tokens
No combination of permissions is appearing to work.
We are also set up with SSO through atlassian cloud so basic auth isn't an option.
Really appreciate the time on this as it's the last piece of an audit puzzle :)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello @alex
Unfortunately Workspace, Project, and Repository Access tokens are not currently supported on 1.0 endpoints.
In this case, you would need to either :
Let me know in case you have any questions.
Thank you, @alex !
Patrik S
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.