Using Circle CI Parameterized Build API for a branch with paths


#1

I’m trying to use the Circle CI Parameterized Build API to trigger builds remotely from the command line. Everything is working fine, and I can build – as long as my branch name doesn’t have paths in it. Unfortunately, a lot of the branches in my org have paths, e.g. this/is/my/branch/name

When I call the api with a path-ed branch name, the build doesn’t trigger, for example:

curl -X POST --header “Content-Type: application/json” https://circleci.com/api/v1.1/project/github/My-Org/My-Project/tree/this/is/my/branch/name?circle-token=

Any advise on how to get this to work?


#2

whoops, branches with paths DO work, I just had the branch name wrong.


#3

Glad you were able to resolve this issue @dapp!

Please let us know if you have any other questions or concerns.

Best, Zak


#4

I have checked, double checked and triple checked, I certainly have the branch name correct.

I have tried this:

curl -X POST https://circleci.com/api/v1.1/project/bitbucket/:username/:project/tree/feature/bogus-ci-pr-test?circle-token=:token

And this:

curl -X POST https://circleci.com/api/v1.1/project/bitbucket/:username/:project/tree/feature%2Fbogus-ci-pr-test?circle-token=:token

In both cases I get:

{
  "message" : "Branch not found"
}

Also see: Cannot trigger build on a branch with slash in name using API


#5

Also having this problem, seems like a bug with the API, would be nice to see a fix!


#6

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.