It's all about the answers!

Ask a question

How to filter DNG RRC API

Rajat Krishnan (70117) | asked Jan 16 '23, 5:55 a.m.
Hello Team,

I am trying to fetch Module Name and Module URI of a RM Stream using DNG RRC API, below mentioned is my api along with header

GET Request :
Header :
Name : oslc_config.context

Now whenever i am hitting this api, so i am getting alot of data along with Module Name and Module URI which result in delayed response time and hugh volume of data in response
So i just wanted to know whether we can somehow append some filter in my Request URI to get only limited data like Module name and Module URI in response?
I have already explored this wiki documentation from jazz :
But i am finding it difficult to understand the wayout, could anyone please support me here

Thank you

Accepted answer

One other answer

permanent link
Ian Barnard (1.9k613) | answered Jan 17 '23, 4:01 a.m.

You're using the DOORS Next "Reportable REST" API. This doesn't have any way to reduce the amount of data returned.

It's important for future compatibility to discover the Query Capability URL i.e. don't hardcode it. This article describes how to discover the OSLC Query Capability and has an example of using query (although doesn't address configurations/components).

Also see this answer  for how to discover components and confiruations and the query capability when using configurations.

To get only modules use;
  • oslc.where=rdm_types:ArtifactFormat=jazz_rm:Module
and the results will have URIs for all modules in the configuration you specify. To also retrieve the title use 
You'll have to provide oslc.prefix to define prefixes such as those used in the above example rdm_types and jazz_rm.

It's also important to url encode all the query parameter values

An example of an encoded full query URL for modules with the title returned is:
  •  https://SERVER:PORT/rm/views?oslc.query=true&projectURL=https%3A//SERVER:PORT%3APORT/rm/process/project-areas/_h2voUFBdEe2rANSH3-kxDg&oslc.prefix=rdm_types%3D%3Chttp%3A//

Rajat Krishnan commented Feb 13 '23, 1:51 a.m. | edited Feb 13 '23, 1:52 a.m.
Is it also applicable for project area with full configuration management enabled?
or we need to add this ?oslc_config.context for same
Actually i tried hitting the above api but it gives below response message
CRRRS4142E getInternalRequestHandlerService(context) returned null. This error used to report 'The requested service requires a private header'.

I have also tried with below header
DoorsRP-Request-Type : public 2.0

Ian Barnard commented Feb 13 '23, 4:26 a.m.

Not sure about your error code without full details of the GET URL, headers, etc.

When accessing the reportable REST API or the OSLC APIs for a configuration-enabled project you need to provide the configurations using either query parameter oslc_config.context or header Configuration.Context.

For OSLC APIs you must also provide header OSLC-Core-Version: 2.0

Ian Barnard commented Feb 13 '23, 6:51 a.m.

That URL isn't encoded correctly. It's ONLY the parameter values that have to be URL encoded, and you have to merge the parameters you want to use with what are already there, i.e. i.e. oslc.query=true and projectURL=... - and ONLY the first parameter is preceded by ? and the following ones are all preceded by & - NOTE This is all standard http needs, nothing to do with ELM.

Ian Barnard commented Feb 13 '23, 6:53 a.m.
Split into lines and decoded, this is:


Rajat Krishnan commented Feb 13 '23, 8:18 a.m.

Header :
Accept : application/rdf+xml
OSLC-Core-Version: 2.0

Response message : java.lang.IllegalArgumentException: The given URI [https://rbubkclm04dexyzcom:9443/rm/views20][views%20] was not a recognised Fronting URI or Storage URI

Rajat Krishnan commented Feb 14 '23, 5:22 a.m.
@Ian Barnard,
I tried to encode only the values but it now throws a different response message
Thank you

Ian Barnard commented Feb 14 '23, 5:26 a.m. | edited Feb 14 '23, 5:27 a.m.

Are you concatenating all the parameters onto the basic URL, i.e. with no line-breaks or space characters? I just used that way of splitting onto lines to make it easier to see the parameters; when you POST it needs to be one long string

Rajat Krishnan commented Feb 14 '23, 7:43 a.m. | edited Feb 14 '23, 7:45 a.m.
@Ian Barnard,
yes i passed it as one complete url (no space no linebreak in between)
sorry i forgot to mention the error message now it shows this

Ian Barnard commented Feb 14 '23, 8:27 a.m. | edited Feb 14 '23, 8:29 a.m.
There's something wrong with what you're doing. The example I gave in my answer worked, with the headers you are using. It's easiest to get this working with a REST client in your browser before coding it. Start by simply using the unadorned query string plus only the oslc_config.context parameter

This should return the (first page of) all the artifacts in the specified configuration. If it doesn't then there's something very basic going wrong. Once that works, add on the and check the results include these values, then add the oslc.where, and so on.

Rajat Krishnan commented Feb 16 '23, 1:45 a.m.
@Ian Barnard,
This works
but whenever i try to add anything it always throws

 <err:detailedMessage rdf:datatype="">Error when converting: oslc.query=true&amp; oslc.prefix=rdm_types=&lt;;&amp; oslc.prefix=dcterms=&lt;;&amp; oslc.prefix=rm_nav=&lt;;&amp; oslc.where=rdm_types:ArtifactFormat=&lt; Encountered "" at line 1, column 26.&#xD; Was expecting one of:&#xD;

Ian Barnard commented Feb 16 '23, 6:11 a.m. | edited Feb 16 '23, 6:13 a.m.
From the little infomation you provided it looks like

a) you're still not url encoding the parameter values correctly.- the value is the bit after the parameter name=, e.g. &oslc.prefix=... for example if you want to specify oslc.prefix=dcterms=<> the value MUST be url encoded - so should appear in the URL as e.g.
Notice how the = in the parameter value isn't visible when url encoded. Also note that XML/HTML escape encoding (e.g. & to &amp;, < to &lt;) is NOT the same as url encoding.

and b) it looks like there are spaces in the url - that WILL make the request FAIL

Also, add one parameter to the URL at a time and check it works before adding the next, because that way you'll get more of a pointer of where you're going wrong.

If it still doesn't work after you';ve fixed these issues paste the entire URL literally as used to make the request in here.

Ian Barnard commented Feb 20 '23, 3:20 a.m.

Hi Rajat  I can't see anything wrong with your query#3 that doesn't work, so I can't explain this, but that style of query works for me.

showing 5 of 18 show 13 more comments

Your answer

Register or to post your answer.

Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.