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

How to authenticate API V2

ryan yang July 20, 2021

I'm unable to get an authorization bearer token using the V2 API. Am I doing something incorrect?

curl -X POST -u "client_id:secret" \
https://bitbucket.org/{COMPANY}/oauth2/access_token -d grant_type=password \
-d username={MY_USERNAME} -d password={MY_PERSONAL_ACCESS_TOKEN}

1 answer

0 votes
ryan yang July 20, 2021

With the Rest V1 api, I could easily reach endpoints in the format:

curl "https://stash.{COMPANY}.com/rest/api/1.0/projects/{Project_KEY}/repos/{Repo_slug}/settings/hooks?type=POST_RECEIVE" \
-u {USERNAME}:{MY_PERSONAL_ACCESS_TOKEN} \
--request GET \
--header 'Content-Type: application/json'

However, I can't do the same for V2

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events