Trigger Build in API with node

I’m trying to trigger an additional build through the API using node. This is probably a node issue, but maybe someone here has experience with something similar.
Here’s the most basic example, which I can’t get to work:

const = 'asdfasdfasdfasdfasdf` // a token generated against my account
const options = {
  headers: {'Authorization': 'Basic ' + circleToken },
  method: 'GET'
fetch(``, options)
  .then(res => res.json())
  .then(json => console.log(json))

The token works against the API in Bash like this:

curl -X POST -u ${CIRCLE_API_TOKEN} --header "Content-Type: application/json" -d '{
  "build_parameters": {
    "CIRCLE_JOB": "visual_regression_test",
    "TEST_SITES": "zilch"

Can you expand on that? Do you get an error? What HTTP response code do you get? etc.

{ message: 'Project not found' }
1 Like

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