It's all about the answers!

Ask a question

How to GET the RelationTypes using REST API.


Ashutosh Chaturvedi (1122) | asked Jan 31 '13, 5:50 a.m.
In my application I need to get the available relation types to relate an asset to the already existing one in RAM using relations like Parent, Dependent, ...etc.
As for communities I performed GET operation on "....../ram/oslc/communities", and getting the result
so by the using same idea I am performing a GET operation on "....../ram/oslc/relationshipTypes", but getting no result.

Is there any other way to get the desired result.

2 answers



permanent link
Gili Mendel (1.8k56) | answered Jan 31 '13, 9:11 a.m.
JAZZ DEVELOPER
Mostly, these are internal APIs (on the <server>/ram/internal path vs. the oslc one). There is no service to find all the relationships in the repository at this time.  I opened Need a Rest API to list existing relationshipType in the repository (79692)

permanent link
Sheehan Anderson (1.2k4) | answered Jan 31 '13, 2:18 p.m.
JAZZ DEVELOPER
 It's not public API, but you can get a JSON representation of the relationships from
http://<server>/ram/internal/service/RelationshipService.getRelationshipTypes

Comments
Ashutosh Chaturvedi commented Feb 01 '13, 1:17 a.m.

Hi Sheehan,
Thanks for the comment, it works, but we need to get the result in xml format.
The headers I am using are: 1. "Authorization: Basic q2hhdHVydkE...."
                                               2. "Accept: application/xml"
I also tried "Accept: application/rdf+xml"
but the format(I think it's a JSON format) I am getting is not the desired one.....
Is there anything I am missing here?
Please comment....


Gili Mendel commented Feb 01 '13, 8:52 a.m.
JAZZ DEVELOPER

Rich Kulp commented Feb 01 '13, 10:14 a.m.
FORUM MODERATOR / JAZZ DEVELOPER

As Sheehan said, the internal form only produces JSON. It is used internally by RAM for the browser support and the browser handles JSON faster than XML. Since it wasn't meant to be an API there wasn't any effort to produce an XML format.

That is what Gili's enhancement is for, to produce the different formats through the more formal REST calls.

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.