I'm trying to use the REST API to label builds. Can someone tell me what curl syntax to use to make this work?
The permutations I've tried are:
$ curl --fail -X POST --user ${BAMBOO_USER}:${BAMBOO_PASSWORD} "${BAMBOO}/rest/api/latest/result/${BUILD_KEY}/label" -d "<label name="release"/>" -H "Content-type: text/xml" curl: (22) The requested URL returned error: 415 $ curl --fail -X POST --user ${BAMBOO_USER}:${BAMBOO_PASSWORD} "${BAMBOO}/rest/api/latest/result/${BUILD_KEY}/label" -H "Content-type: text/xml" <<EOF <label name="release"/> EOF curl: (22) The requested URL returned error: 415
I've also tried it both ways without the -H option.
Community moderators have prevented the ability to post new answers.
Try this:
curl -v -X POST --user ${BAMBOO_USER}:${BAMBOO_PASSWORD} "${BAMBOO}/rest/api/latest/result/{projectKey}-{buildKey}-{buildNumber}/label" -d '<?xml version="1.0" encoding="UTF-8" standalone="yes"?><label name="release"/>' -H "Content-type: application/xml"
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.