You're on your way to the next level! Join the Kudos program to earn points and save your progress.
Level 1: Seed
25 / 150 points
Next: Root
1 badge earned
Challenges come and go, but your rewards stay with you. Do more to earn more!
What goes around comes around! Share the love by gifting kudos to your peers.
Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!
Join now to unlock these features and more
I am trying to create a repo in bitbucket cloud with:
curl --request GET \
--url 'https://api.bitbucket.org/2.0/repositories/{workspace}/{repo_slug}' \
--header 'Authorization: Bearer <access_token>' \
--header 'Accept: application/json'
The problem is with the "access_token".
I tried to put there my app password, ssh key, login password, but I always get back the same error:
{"type": "error", "error": {"message": "Access token expired."}}
I created a OAuth 2.0 key and secret, but can't extract a access token from them:
curl -X POST -u "key:secret" \
https://bitbucket.org/site/oauth2/access_token \
-d grant_type=authorization_code -d code={code}
returns
error: "Cannot use client_credentials with a consumer marked as \"public\". Calls for auto generated consumers should use urn:bitbucket:oauth2:jwt instead.", "error": "invalid_grant"}
That being said, in order to create a new repository using Basic Authentication your cUrl command would look like the following :
curl -u "<Bitbucket Username>:<AppPasswords>" -X POST -H "Content-Type: application/json" -d '{ "scm": "git", "is_private": true, "project": { "key": "<your project key>" } }' https://api.bitbucket.org/2.0/repositories/<workspace>/<repository>
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.