It's all about the answers!

Ask a question

REST API to query for requirements from DNG

Anne C (132) | asked Jul 30 '20, 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 (2.1k217) | answered Jul 30 '20, 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

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

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

Anne C commented Aug 03 '20, 10:46 a.m.

Can you provide a link to the DNG Wiki?

Anne C commented Aug 03 '20, 2:37 p.m.

 Is this the correct wiki -

Davyd Norris commented Aug 03 '20, 7:09 p.m.

Anne C commented Aug 04 '20, 3:41 p.m.

  In this question, he states that the ReqIF ( is not a publicly available REST API but the question was answered 3 years ago.  Is this still the case?

Davyd Norris commented Aug 04 '20, 6:00 p.m.
It is actually available through the OSLC approach, but if you can possibly use the Reportable REST API I would use that.

I've looked at it briefly before, and I don't think the ReqIF API will give you what you are looking for - if you were looking for more than just reading requirements I would use the OSLC API, as that's what it's there for.

showing 5 of 6 show 1 more comments

Your answer

Register or to post your answer.