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

This endpoint does not support token-based authentication | Default reviewers

Jaipal Solanki
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!
January 23, 2024

Hi Guys,

I am trying to add default reviewers to particular repositories using automation.

I am using the following endpoint to make an API call,

"https://api.bitbucket.org/2.0/repositories/workspace/repo_name/default-reviewers", authentication is Token based (Username and Password), but I am getting the below error.

`This endpoint does not support token-based authentication`
Is there anything I am missing?
Can someone please navigate me through this?
Thank you
Jaipal

1 answer

1 accepted

1 vote
Answer accepted
Theodora Boudale
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
January 24, 2024

Hi Jaipal and welcome to the community!

A call like the following with curl (using username and app password for authentication), should work:

curl -u username:app_password --request PUT \
--url 'https://api.bitbucket.org/2.0/repositories/workspace-id/repo-slug/default-reviewers/reviewer_username' \
--header 'Accept: application/json'

where

  • username is the Bitbucket username of a user with admin access to the repo (it can be found here https://bitbucket.org/account/settings/ if this is your own user account)
  • app_password is an app password for this user with at least Repositories - Admin permissions (the account's password will not work, this can only be used for logging in to the website from browser)
  • workspace-id is the ID of the workspace the repo belongs to
  • repo-slug is the slug for the repository (you can see it in the repo URL on browser)
  • reviewer_username is the Bitbucket username of the reviewer you want to add

I just ran such a call for one of my own repos for testing purposes and the reviewer is added.

Please feel free to let me know if it works for you and if you have any questions.

Kind regards,
Theodora

Suggest an answer

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

Atlassian Community Events