Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Bitbucket Cloud Rest Api for pipelines doesn't work properly

Peter Jeong August 7, 2023

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

2 answers

1 accepted

0 votes
Saxea _Flowie_
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
August 7, 2023

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....

Peter Jeong August 7, 2023

thanks you're answer.

but in pipelines they're default variables.

and I print them it work

Saxea _Flowie_
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
August 7, 2023

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

Peter Jeong August 7, 2023

I added authorization but it returns 400 error with unexpected response body

 

I think it is problem of Bitbucket Cloud

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PERMISSIONS LEVEL
Product Admin
TAGS
AUG Leaders

Atlassian Community Events