Hello, I want to trigger a pipeline from one repository of my organization using the API.
I had a look at this post and this documentation but it doesn't seem to work.
So I went to https://bitbucket.org/account/settings/app-passwords/ and I created an app password with all the rights (I guess I just need "write" on "pipeline" but this is just for testing).
Then I used this curl command:
curl -X POST -is -u <user@organization.com>:<myapppassword> \
-H 'Content-Type: application/json' \
https://api.bitbucket.org/2.0/repositories/<organization>/<repo>/pipelines/ \
-d '
{
"target": {
"ref_type": "branch",
"type": "pipeline_ref_target",
"ref_name": "master"
}
}'
But it gives me a 401 error.
if I use my account password, the query is successful and it triggers the pipeline.
For obvious security reasons I don't want to use my password to trigger a pipeline through a script, but just a token I can revoke at any time.
Any idea how I can trigger the pipeline using the API?