Home Getting build history from jenkins from rest service
Reply: 1

Getting build history from jenkins from rest service

Venkatesh K
Venkatesh K Published in 2017-12-07 06:55:12Z

Presently i am developing a angular application which shows the data of the builds from jenkins. So how to get that data from jenkins as a rest service.present i am using http://YOUR_JENKINS:8080/job/YOUR_JOB/api/xml?%20tree=jobs[name]{0,10}. but i am getting 403 unautharized. please can anybody help me in this issue.

sanath meti
sanath meti Reply to 2017-12-09 18:21:19Z

you need to use the jenkins user token in-order to make the rest call to jenkins api.

For csrf / crumb issues. Need to get crumb from Jenkins using below command

wget -q --auth-no-challenge --user admin --password admin --output-document - ',":",//crumb)'

This will return crumb value, then add this to Jenkins rest API

curl -I -X POST http://admin:85703fb68927f04968630e192e4927cb@ -H "Jenkins-Crumb:44e7033af70da95a47403c3bed5c10f8"

Below link explains in-detail http://www.inanzzz.com/index.php/post/jnrg/running-jenkins-build-via-command-line

You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.338742 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO