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"}