Trigger a new Build by Project ignores [branch|revision|tag] parameter

I’m trying to use the API to build a project by calling

curl -X POST “https://circleci.com/api/v1.1/project/github/rapros/elsbot-demo/build?branch=my-branch&circle-token=:token

but CircleCI will always build master. It also does not work with revision or tag parameter as outlined here https://circleci.com/docs/api/#trigger-a-new-build-by-project-preview

Any hints?

2 Likes

Oh. The API documentation is very confusing. This part does not mention that parameter is not a query parameter but a json key.

One needs to call

curl -X POST --header “Content-Type: application/json” -d ‘{“branch”: “feature-branch” }’ “https://circleci.com/api/v1.1/project/github/rapros/elsbot-demo/build?circle-token=:token

I’m also having the same problem where tags are ignored. When will this feature be fixed CircleCI team?