Jazz Forum Welcome to the Jazz Community Forum Connect and collaborate with IBM Engineering experts and users

How to GET the RelationTypes using REST API.

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.

0 votes



2 answers

Permanent link
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)

0 votes


Permanent link
 It's not public API, but you can get a JSON representation of the relationships from
http://<server>/ram/internal/service/RelationshipService.getRelationshipTypes

0 votes

Comments

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....

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 log in 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.

Search context
Follow this question

By Email: 

Once you sign in you will be able to subscribe for any updates here.

By RSS:

Answers
Answers and Comments
Question details

Question asked: Jan 31 '13, 5:50 a.m.

Question was seen: 5,648 times

Last updated: Feb 01 '13, 10:14 a.m.

Confirmation Cancel Confirm