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

How to create API Token

zw t July 14, 2022

{"type": "error", "error": {"message": "Access token expired."}}

 

image.pngthis is invalid,I tried to follow the guidelines but still can't solve it.Because I can't set valid time and permissions

image.png

https://confluence.atlassian.com/bitbucketserver071/personal-access-tokens-998653440.html#Personalaccesstokens-Generatingpersonalaccesstokens

1 answer

0 votes
Ben
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
July 17, 2022

G'day!

Welcome to the Bitbucket Cloud Community! :) 

The correct procedure to follow to create an OAuth access token can be found at the link below and is as follows:
https://support.atlassian.com/bitbucket-cloud/docs/use-oauth-on-bitbucket-cloud/

  1. From your profile avatar in the bottom left, click on the workspace in the Recent workspaces list or click All workspaces to open an entire list from which to choose.

  2. Click Settings on the left sidebar to open the Workspace settings.

  3. Click OAuth consumers under Apps and features on the left navigation.

  4. Click the Add consumer button.  

    The system requests the following information:

    Name: The display name for your consumer. This must be unique within your account. This is required.
    Description: An optional description of what your consumer does.
    Callback URL: Required for OAuth 2.0 consumers.

    When making requests you can include a call back URL in the request:

    • If you do include the URL in a request it must be appended to the same URL configured in the consumer. So if your consumer callback URL is example.com/add-on the URL in your request must be something similar to example.com/add-on/function.

    • If you don't include the URL in the request we redirect to the callback URL in the consumer.

    URL: An optional URL where the curious can go to learn more about your cool application.

  5. Click Save. The system generates a key and a secret for you.

  6. Toggle the consumer name to see the generated Key and Secret value for your consumer.

Once you have the Key and Secret value generated, you can then request the access token by running an API command based on the OAuth flow you are using:
https://developer.atlassian.com/cloud/bitbucket/oauth-2/

For example - client credentials flow:

curl -s -X POST -u "client_id:secret" https://bitbucket.org/site/oauth2/access_token -d grant_type=client_credentials

 

Hope this helps.

Cheers!

- Ben (Bitbucket Cloud Support)

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
TAGS
AUG Leaders

Atlassian Community Events