How to get user profile image via API
<rtc_cm:User rdf:resource="https://<HOST>/jazz/oslc/users/_tKYZEArvEd-_CvlJWZEkGw">
You have followed a direct link to content hosted in a Jazz server. This page has been presented to ensure that a malicious website cannot use cleverly crafted content to circumvent security. If you would like to access the content, please use the link below.
Accepted answer
If you are writing a Jazz Plugin (e.g. a Dashboard Viewlet), you can use the following code to access a users profile (userId is the standard Jazz User ID that is used for the login as well, e.g. ADMIN):
2 other answers
See https://rsjazz.wordpress.com/2013/01/08/maintaing-user-photos-with-the-plain-java-client-libraries/
Comments
Thank you Ralph, but I'm unfortunately limited to JavaScript based solutions...
The URI I get for the Photo is
https://server:port/rtc/service/com.ibm.team.repository.service.internal.IMemberPhotoService?contributorItemId=_SLSW8JQLEd-DaZzUk6UM4g&etag=_t0j6YuloEeKAzb0FcRrWoQ
And how do you get the ItemID of the user, without using RTC SDK? OSLC lacks the ability to query the itemID of the user, I only get the jazz ID
Thank you Ralph for your suggestion. I was unable to use the one you have suggested, but I found a service that accepts a userId. See my answer below....
Comments
Aaron Allsbrook
Oct 16 '12, 3:41 p.m.Tried some additional testing today with RTC 4. It appears to not have the security prevention intercept on it there. Consequently I am able to pull the images correctly in RTC 4.
Mike Shkolnik
Sep 05 '13, 5:52 p.m.Aaron, I am having the same issue trying to pull photos from RTC 4.0.1 through the API. I have tried two different methods. The one you show above, which is based on a resource ID of the photo, and this method, based on the itemId of the user:
https://SERVER:PORT/jazz/service/com.ibm.team.apt.internal.service.rest.IResourcePlanningRestService/workEnvironment?contributorId=USERITEMID
Unfortunately, I get the same results with both methods, the "you have found a direct link" error. Were you ever able to solve this?
Mike Shkolnik
Sep 05 '13, 5:56 p.m.Just tried a third method - same result:
https://SERVER:PORT/jts/users/photo/USERID
Lukas Steiger
Jul 25 '17, 3:23 a.m.Have you ever found a solution on this?
I'm facing the same issue...