Hello,
I tried the python snippet below however, it returned 'This endpoint does not support token-based authentication'.
import json
import requests
access_token = "sample_token"
workspace = "sample_workspace"
repo_name = "sample_repo"
url = f"https://api.bitbucket.org/internal/repositories/{workspace}/{repo_name}/access-tokens"
headers = { "Accept": "application/json", "Content-Type": "application/json", "Authorization": f"Bearer {access_token}" }
payload = json.dumps({ "name": "Test2", "scopes": ["webhook", "pipeline", "pipeline:write", "pipeline:variable", "runner:write"] })
response = requests.request( "POST", url, data=payload, headers=headers )
My general intention is for automation. I would like to avoid doing manual work for setting-up a bitbucket pipeline workflow where in the process it will trigger another pipeline on another repo from a particular bitbucket pipeline using `pipe: atlassian/trigger-pipeline` where the authorization that will be used is `BITBUCKET_ACCESS_TOKEN`.
Regards,
Hi and welcome to the community!
As Aron said, this is not possible at the moment. We have a feature request for the ability to manage access tokens via API:
You can add your vote (by selecting the Vote for this issue link) to express your interest and you can also add yourself as a watcher (by selecting the Start watching this issue link) if you'd like to be notified via email on updates.
Kind regards,
Theodora
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Dean Christian Armada I think, similarly to the Atlassian API tokens, these cannot be created through the API, because that would reduce their level of security.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
From setup to deployment—this learning path shows you how to build your first app using Forge. Learn the essentials, streamline workflows, and bring custom solutions to life across Jira, Confluence, and more.
Start Learning
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.