I\'ve seen similar posts to this on SO, but not quite exactly what I am trying to do (or at least no full examples of a command to run).
I am trying to remotely trig
This is emphasis on @seeker 's answer.
Pay extra attention to getting the crumb step
As the other answers mentioned, the crumb you get may differ depending on the browser you use to browse to Jenkins, be it Chrome, Curl or WGet.
But, and this is an important but, the crumb that I used for the CURL command is the one I got from the WGET command. It isn't the crumb I got from the CURL -X GET command.
I am not clear on why this is the case, but like in @Seeker 's answer, this worked for me.
I got different crumbs when
Browsing to http://qajenkins:8080/crumbIssuer/api/xml
Browsing to http://10.143.18.43:8080/crumbIssuer/api/xml (qajenkins = 10.143.18.43)
Running
curl -X WGET http://10.143.18.43:8080/crumbIssuer/api/xml
Or running
wget -q --auth-no-challenge --user raamee --password 12345678 --output-document - 'http://10.143.18.43:8080/crumbIssuer/api/xml?xpath=concat(//crumbRequestField,":",//crumb)';echo
In order to get the curl command
curl -X POST -H "Jenkins-Crumb:2e03fc96f387abggga6581fe5883a14a" http://10.143.18.43:8080/view/Raamee_phase_2/job/test_remote_api_triggerring/buildWithParameters?token=MY_TOKEN --user "raamee:12345678"
I used the crumb I got from the wget command, the 4th command.