2

I am trying to use the bitbucket API for getting details of my repositories, issue, etc., but I am not able to find a clear way of authenticating the API request.

I would like to have a simple way of authenticating the endpoints like https://api.bitbucket.org/2.0/repositories/usamarehank_dckap?access_token={my_access_token}

Here I obtained the access token from the app password section of my account.

I am getting an error on doing so like

{"type": "error", "error": {"message": "Access token expired. Use your >refresh token to obtain a new access token."}}

I tried using consumer key creation but I am not sure where to plug those values in the request and with the OAuth it asks for client_id which I am pretty sure not giving in the docs where to get them.

How would I basically do a simple access_token request just like github API without any OAuth?

Rehan
  • 85
  • 2
  • 2
  • 8

1 Answers1

0

Right, this access_token is part of the OAuth authentication process: https://confluence.atlassian.com/bitbucket/oauth-on-bitbucket-cloud-238027431.html

To use just these app passwords you can create via your profile, you need to use simple Basic Authentication with that app password.

You can read a bit more about it here: https://developer.atlassian.com/bitbucket/api/2/reference/meta/authentication

TheFRedFox
  • 600
  • 3
  • 12
  • 1
    thx @DrCord changed it with a new link with information about api authentication. – TheFRedFox Sep 15 '20 at 15:19
  • 1
    it's typically better for this reason to include the relevant information directly into your post and then a link to the original source. – DrCord Sep 16 '20 at 23:51