How to get the result by Json in Rest API ?
Hello
I want to get the Result in Json for Rest Url
Below is the link i am using to get the result using json. Please let me know where i am missing ?
https://rb-ubk-clm-04.de.bosch.com:9443/ccm/rpt/repository/workitem?fields=workitem/workItem[id=%275501%27]/%28children/%28target/name|id|category/name%29%29&_mediaType=text/json&_pretty=true
I want to get the Result in Json for Rest Url
Below is the link i am using to get the result using json. Please let me know where i am missing ?
https://rb-ubk-clm-04.de.bosch.com:9443/ccm/rpt/repository/workitem?fields=workitem/workItem[id=%275501%27]/%28children/%28target/name|id|category/name%29%29&_mediaType=text/json&_pretty=true
2 answers
Please go through the
Open Services for Lifecycle Collaboration Workshop
You have to specify application/json in the request header. the mediaType is not what OSLC is looking for.
You have to specify application/json in the request header. the mediaType is not what OSLC is looking for.
Comments
hello Ralph
i tried even with this link :
https://rb-ubk-clm-04.de.bosch.com:9443/ccm/rpt/repository/workitem?fields=workitem/workItem[id=%275501%27]/%28children/%28target/name|id|category/name%29%29&_mediaType=application/json&_pretty=true
but we are not getting the result in json format :(
I would really consider to read the document and play with the examples to understand what you need to do. Just adding stuff to the URL does NOT set the request header.
This is a screenshot of a REST client with proper headers set:
Do the Open Services for Lifecycle Collaboration Workshop
I don't think the RTC reportable REST API is implemented with JSON at all. It ignores "Accept" header, and does not recognize file extension (*.xml, *.json and etc). It _always_ respond with XML content (there is no content negotiation). In other words, no matter how you "trick" the server, it will not give you media type other than XML.