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.