I’m using python to kick off some specific jobs. Here is my code:
from botocore.vendored import requests
CIRCLE_TOKEN=“XXXX”
BUILD_URL=“https://circleci.com/api/v1.1/project/github/xxxx?circle-token={0}”
r = requests.post(BUILD_URL.format(CIRCLE_TOKEN), data={“build_parameters” : {“CIRCLE_JOB”: “do_staging”}})
print (‘kick off status: {0}’.format(r.status_code))
print (‘kick off body: {0}’.format(r.json()))
And it returns:
kick off status: 400
kick off body: {'message': 'Invalid build_parameters value: must be a map'}
I can’t for the life of me figure out how to get this to work in python. Works fine in a curl statement.