How do I get started with REST API?
Hi.. I'm trying to get a start with the REST API. I found this question/answer useful for logging in and I can do that. Now I'm trying to find out what services and URLs I need to use. The wiki documentation seemed like it was really going to be helpful but my situation seemed to go off the rails at step 1 since in our installation, there is no "rootservices" URL. I used our basic URL that worked for the login (which was https://ourhost/ccm2/service) and that is providing me with a catalog of services but it's in HTML format, even when I send an Accept header, e.g.:
curl -k -L -b $COOKIES -c $COOKIES -o services.xml -H "application/xml" $HOST
So a couple of questions:
1) Is there a better way to force an output format from the service request?
2) Am I using the most current reference for the REST API in the link above? I.e., the wiki documentation?
3) For RTC, does anyone know of a compilation of snippets and samples? I've done a lot of searching but there are a wide range of REST API topics out there and I haven't hit on something like this for RTC
4) I currently use the Java API with success, is the REST API faster? Can it do the same thing? Oops - found this answered here.
Thanks for your comments and suggestions!
- Andy
One answer
Your link is an old one. This is more up to date:
https://jazz.net/wiki/bin/view/Main/WorkItemAPIsForOSLCCM20
There's quite a few examples in there.
It may help if you shared what you planned to accomplish by using the API. For example, if you only need to read data, the Reportable REST API is worth investigating:
https://jazz.net/wiki/bin/view/Main/ReportsRESTAPI
https://jazz.net/wiki/bin/view/Main/WorkItemAPIsForOSLCCM20
There's quite a few examples in there.
It may help if you shared what you planned to accomplish by using the API. For example, if you only need to read data, the Reportable REST API is worth investigating:
https://jazz.net/wiki/bin/view/Main/ReportsRESTAPI
Comments
Well, it's a good question but I can't really answer it. I was hoping to get smart on it then compare the relative merits myself. I am using the Java API currently and I wanted to find out if the REST API had some endearing qualities that would influence me to use it rather than the Java API.
It seems to be a matter of preference in choosing an API. Perhaps if someone only had access to an HTTP client, that would influence the REST approach.
1 vote
You might also get a lot of value from doing the OSLC Workshop. It's free and you can do it at your own pace.
1 vote