It's all about the answers!

Ask a question

REST API to query for requirements from DNG


Anne C (131) | asked Jul 30, 6:02 p.m.

We have a custom Java application (not in the Jazz ecosystem) and would like to query DNG for all requirements using REST services (currently we manually export/import via CSV and would rather export/import programmatically via REST).


Questions are:
  1. Is this possible and if so, is the OSLC REST API or the Reporting REST API the correct path to go down (we only need a basic subset of requirement attributes)?
  2. Is the response data in human readable XML or JSON format?
  3. Would either of these REST APIs limit the response data, and if so, does the response data provide pagination info?
  4. Are queries filterable (e.g. get me all the requirements where the name starts with "ABC*")?

Accepted answer


permanent link
Davyd Norris (7316) | answered Jul 30, 6:49 p.m.
Hi Anne,

A lot of this is covered in the DNG Wiki - great resource for all this. There's also some sample code out there that shows you how to do some of this.

1. If you are only looking to read the requirements, and only looking to get a subset of attributes, then the Reportable REST API would be the simplest interface, as it's simply an authenticate step followed by queries. The OSLC API involves quite a few more steps to do the same thing, but it gives you a lot more power in terms of CRUD operations.

2. The Reportable REST API returns XML documents formatted according to the schema of the resource you're retrieving, so if you are looking at base text artefacts, the retrieved results will be formatted according to https://<your server>/rm/publish/text?metadata=schema. The OSLC API returns XML, ATOM, JSON depending on what you ask for.

3. Both limit the response data but return a bookmark to enable pagination through large result sets, and both offer parameters to increase the size of the results returned per page

4. Both have query capability, but there are some limitations - for instance the Reportable REST API uses XPath but not the full spec, and I don't believe starts-with is one of the supported functions, but there are lots of ways to create query sets with other parameters. You also have the ability to create Views in DNG and retrieve those directly.
Anne C selected this answer as the correct answer

Comments
Anne C commented Jul 30, 11:07 p.m.

Thanks for the info!  I will check out the DNG Wiki.


Anne C commented 11 hours ago

Can you provide a link to the DNG Wiki?


Anne C commented 8 hours ago

 Is this the correct wiki - https://jazz.net/wiki/bin/view?


Your answer


Register or to post your answer.