Any plan to Access Token "Get current user" API support?

Genta Kuroki
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!
December 24, 2024

Question:

I tried to curl /user using Repository Access Token, but failed.

$ curl --request GET   --url 'https://api.bitbucket.org/2.0/user'   --header 'Authorization: Bearer {REPOSITORY_TOKEN}'   --header 'Accept: application/json'
{"type": "error", "error": {"message": "Token is invalid or not supported for this endpoint."}}

Any plan to support this API?

 

What I want to do:

I want to create pull request using this Repository Access Token, NOT App password .

App password is directory related my Bitbucket account. This is not suitable for my usage.

 

What I checked

When I created pull request with Repository Access Token, something like bot account created pull request.

Therefore, seems possible to me to get the info on the account, which account type is "App User".

1 answer

0 votes
Patrik S
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
December 26, 2024

Hello @Genta Kuroki ,

and welcome to the Community!

As you've correctly noted, every Access Token is associated with a bot user. This bot user is automatically created and is unique to each access token. You can find details such as the ID and email associated with the bot user by accessing the access token in the Bitbucket UI.

However, it's important to note that the bot user is limited in scope and capabilities. The information available from this bot, such as its name or any other account profile details, cannot be altered. The /user endpoint is not supported with Access Tokens because it's designed to retrieve personal user information, which doesn't apply to bot users.

With that in mind, could you provide us with more context about the specific information you are seeking from the bot account by calling the /user endpoint? 

Thank you, @Genta Kuroki !

Patrik S

Genta Kuroki
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!
December 26, 2024

Hello @Patrik S 

I want to use uuid.

There are many endpoints containing uuid, and I want to filter using uuid.

 

I think about following usecase:

(In Bitbucket Pipelines or somewhere)

Repository | Project | Workspace Access Token

-> /user API

-> get uuid

-> use many endpoints to filter responses

 

Thank you @Patrik S 

 

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PERMISSIONS LEVEL
Product Admin Site Admin
TAGS
AUG Leaders

Atlassian Community Events