Missed Team ’24? Catch up on announcements here.

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

Bitbucket API v2 returns account object not including username?

大表正人
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
June 13, 2019

Hi team,

According to the Bitbucket API v2 Reference, /users/[username] returns account object, and account object contains username.

https://developer.atlassian.com/bitbucket/api/2/reference/resource/users/%7Busername%7D

and, commit's author, PR's author, PR comment's author, etc contains account object.

https://developer.atlassian.com/bitbucket/api/2/reference/resource/repositories/%7Busername%7D/%7Brepo_slug%7D/pullrequests/%7Bpull_request_id%7D

 

but now these APIs return account object not including username:

$ curl --user [username]:[password] https://api.bitbucket.org/2.0/users/[username]
{"display_name": "XXXXXX", "uuid": "{XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX}", "links": {"hooks": {"href": "https://api.bitbucket.org/2.0/users/XXXXXXXXXX/hooks"}, "self": {"href": "https://api.bitbucket.org/2.0/users/XXXXXXXXXX"}, "repositories": {"href": "https://api.bitbucket.org/2.0/repositories/XXXXXXXXXX"}, "html": {"href": "https://bitbucket.org/XXXXXXXXXX/"}, "avatar": {"href": "https://avatar-cdn.atlassian.com/XXXXXXXXXXXXXXXXXXXX.png"}, "snippets": {"href": "https://api.bitbucket.org/2.0/snippets/XXXXXXXXXX"}}, "nickname": "XXXXXX", "created_on": "2018-10-02T01:45:49.883735+00:00", "is_staff": false, "account_status": "active", "type": "user", "account_id": "XXXXXXXXXXXXXXXXXXXX"}

 

Is this a bug?

1 answer

1 accepted

0 votes
Answer accepted
Stephen Sifers
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
June 17, 2019

Hello,

It looks as though what you’ve found is part of the GDPR and user privacy notice which impacted how user names are displayed. The change came on the 29th of April 2019. Further information about this may be found at the change notice; Bitbucket Cloud REST APIs are changing to improve user privacy.

I hope this helps to answer your question along with providing the additional information around why/when this change occurred.

Regards,
Stephen Sifers

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events