Using the Rational® ClearQuest® OSLC CM REST API
The Rational® ClearQuest® OSLC 1.0 and OSLC 2.0 REST API is a RESTful (Representational State Transfer) interface that adheres to the Open Services for Lifecycle Collaboration (OSLC) 1.0 and 2.0 Core and Change Management (CM) specifications.
If you are familiar with Rational®
ClearQuest® OSLC
1.0, you are able to upgrade to the OSLC 2.0 APIs. There are some important differences:
- Rational®
ClearQuest® OSLC 2.0 XML responses are
now RDF/XML. A library for parsing RDF makes these responses much easier to work with. Rational® ClearQuest® supports RDF/XML (
application/rdf+xml) and JSON (application/json) content for all resources. For queries, Rational® ClearQuest® supports Atom (application/atom+xml), and for records, it supports HTML (text/html). Content is negotiated by using the HTTP Accept request header as defined in RFC 2616. To request RDF/XML content, use this request header.Accept: application/rdf+xmlYou can request more than one content type in theAcceptheader. For instance,Accept: text/html,application/atom+xmlYou can also request content by using thercm.contentTypeparameter.
The value ofGET http://quagmire.rtp.raleigh.ibm.com/cqweb/oslc/?rcm.contentType=application/jsonrcm.contentTypeis always used if supplied, no matter what value is present in theAcceptheader. However, it is best to use the HTTP Accept header for compatibility with other OSLC-CM providers. If no content type is requested that uses either theAcceptheader orrcm.contentType, RDF/XML is returned.Note: If you want to use RDF/XML, Rational® ClearQuest®strongly recommends using a library for parsing RDF such as Jena, a Java™ framework for semantic web applications. This is easier and less error-prone than trying to parse responses as XML. - You no longer must use a special content type to request standard OSLC field values. Rational® ClearQuest®OSLC 2.0 RDF/XML and JSON responses contain both standard OSLC ChangeRequest properties and Rational® ClearQuest® (CQ) field values.
- You must include all field values in a PUT request, not just the fields you want to update, if
you don't set the
parameter. See Working with Records: PUT.oslc.properties - CQ OSLC 2.0 has a different query URL for each record type. The
rcm.typeparameter is no longer required for queries. - Many namespaces and parameter names are changed. See the OSLC-CM 2.0 Specification.
Note: You can use the ClearQuest® OSLC 2.0 CM REST API to
programmatically run all ClearQuest® functions except adding an
attachment to a record. In Rational®
ClearQuest®, you
must use the Rational®
ClearQuest® OSLC 1.0 CM REST API to add a
record attachment.