According to https://developer.atlassian.com/cloud/bitbucket/rest/api-group-workspaces/#api-workspaces-workspace-members-get I should be able to include user email addresses in the response by making use of the fields parameter.
It just doesn't work for me. Using the following api query:
https://api.bitbucket.org/2.0/workspaces/my-workspace/members?fields=values.user.account_id,values.user.email
gives me a list of users where the only attribute is account_id whereas I would expect the email address as well:
{
"values": [
{
"user": {
"account_id": "712020:b404d03e-000a-4c17-8d56-99f10528950c"
}
]
}
I tried using values.user.* in the fields value and all kind of attributes for each user is returned but not the email.
I also tried to include user emails querying other endpoints like pull requests and this query gives me only the account id for each user:
https://api.bitbucket.org/2.0/repositories/my-workspace/repo-abc/pullrequests?fields=values.author.email,values.author.account_id
I tried authenticating with Oauth2 and App Password as well, being a Workspace owner. Same result either way.
Is this something that just doesn't work or am I experiencing some other kind of issue? Thanks so much!
Hi @Mariano B
Unfortunately, the documentation is incorrect—we don't expose user email in our API endpoints, so it can't be used for filtering. I've just raised an internal documentation request to update this and remove this section, as it is confusing.
There is an existing feature request raised with our developers requesting that email be included in the API, please feel free to Watch it for future updates and Vote for it to improve its visibility with regard to customer demand:
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.