It's all about the answers!

Ask a question

REST API server 4 does not return user in JSON format


Alain robert (1156) | asked Mar 04 '13, 6:53 p.m.
edited Mar 04 '13, 7:01 p.m.

Hello,

Before we upgraded our server to RTC 4 I was able to run a REST GET to the users service and receive the answer in a JSON table.

 https: //<server>:<port>/jts/users/<userid>?_mediaType="application/x-oslc-cm-change-request%2Bjson

The server was upgraded to the version below and since then the response is returned in XML and I did not find any way around it.

Change and Configuration Management - Core Libraries 4.0.0.1 RTC-I20120911-1740 Jazz Foundation - Core Libraries 4.0.0.1 RJF-I20120906-1745 236526: Contributor itemId value corrupted in TeamContributorSelectionDialog 4.0.0.1 wi236526 v20121119_0155

Anybody noticed something similar and has as suggestion?

Should I change the mediaType , should I use a different method with the users service to obtain JSON data?

Thanks,

Alain


Comments
Binoy D'costa commented Mar 22 '13, 11:26 a.m.

yes. i seem to have the same issue. My Rest API call Accept headers were JSON format, and it returns in rdf+xml. I can't seem to get around it either. Do you have any update?


Timur Markunin commented Apr 05 '13, 11:14 a.m.


Hello Alain,

I'm faced the same issue for resource allocation. I used URI
 https://clm.local:9443/ccm/rpt/repository/apt  that previously returned XML with hrefs that pointed to JSON message.

I have to use different URI now:

 https://clm.local:9443/ccm/rpt/repository/apt?fields=apt/workResourceDetails/(contributor/name|assignment|startDate|endDate) 

See:
https://jazz.net/forum/questions/108307/closedoslc-how-to-process-character-in-httprequest

2 answers



permanent link
Binoy D'costa (9532537) | answered Apr 05 '13, 10:44 a.m.
The URL for getting user information must be a query of oslc format:

$JAZZHOST/oslc/users.json?oslc_cm.query=rtc_cm:userId=%22$UID%22%20&oslc_cm.properties=*"

This worked for me. Hope this helps anyone who is experiencing the same issue.

Thanks,
Binoy

Comments
Alain robert commented Apr 18 '13, 9:35 a.m.

Hello ,

I am using the URL returned in an WorkItem, it is not practicle to have to change the request to get the user information.

I expect the URL to return JSON format.

I registered defect 261448 for this issue.

Thanks,

Alain


permanent link
Jerome Lanneluc (21015) | answered Apr 05 '13, 4:36 a.m.
JAZZ DEVELOPER
It sounds like a regression was introduced in 4.0.0.1. You should enter a defect.

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.