I want to get pipeline details via Bitbucket Cloud rest api
I'm using this https://developer.atlassian.com/cloud/bitbucket/rest/api-group-pipelines/#api-repositories-workspace-repo-slug-pipelines-pipeline-uuid-get
But this doesn't work properly. always return 404
I using like this on script
curl --request GET \ --url "https://api.bitbucket.org/2.0/repositories/${BITBUCKET_WORKSPACE}/${BITBUCKET_REPO_SLUG}/pipelines/${BITBUCKET_PIPELINE_UUID}" \ --header "Accept: application/json"
how to handle it?
----- added on
not only get a pipeline but also list pipeline same as
I solved with https://community.atlassian.com/t5/Bitbucket-questions/quot-Unexpected-response-body-quot-in-API-call-to-pipelines-uuid/qaq-p/1868756
It seems you are not setting the variables with the actual values? You can do it by prepending it to the cmd:
BITBUCKET_WORKSPACE=myWORKSPACE curl --request....
thanks you're answer.
but in pipelines they're default variables.
and I print them it work
hmm... right.... have you tried listing the pipelines instead to see if it works? Dunno, but maybe the pipeline isn't still persisted when you try to access it from itself?
Also, are you handling the authentication too?(I would expect 403/401) if this was the problem, not 404
I added authorization but it returns 400 error with unexpected response body
I think it is problem of Bitbucket Cloud
It looks like you're new here. Sign in or register to get started.