It's all about the answers!

Ask a question

REST API to retrieve user URL reference from userid


Sky Matthews (3632) | asked Sep 18 '09, 10:13 a.m.
Is there a way to retrieve the URL identifier for a user by looking up their ID? I'm trying to assign a work item to a particular user when POSTing the work item to the work item factory using the 'rtc_cm:ownedBy' field. I know their ID but can't see a way to look up their internal URL. The post returns a 409: Conflict code and this is the line of code that causes it. I'm guessing that the cause is that it requires the actual user URL and not their simple id.

I used the following line of code to set the ownedBy value:
NameValuePair wiOwner = new NameValuePair("rtc_cm:ownedBy","architect");

3 answers



permanent link
Sky Matthews (3632) | answered Sep 18 '09, 10:45 a.m.
Although not found by my initial simple scan, this appears to be answered by another recent post:

http://jazz.net/forums/viewtopic.php?t=6783

I would echo much of what Adrian said. The point of providing REST APIs is so that a client with relatively little knowledge can do something on the resources. Any resource that is referenced by an URL but known externally by some other key ought to be "lookup-able" by key to get the URL. This is true for most resources already.

In the meantime, I'll try the email tag trick suggested by Patrick:
<rtc_cm>

permanent link
Patrick Streule (4.9k21) | answered Sep 18 '09, 12:00 p.m.
JAZZ DEVELOPER
Although not found by my initial simple scan, this appears to be
answered by another recent post:

http://jazz.net/forums/viewtopic.php?t=6783

I would echo much of what Adrian said. The point of providing REST
APIs is so that a client with relatively little knowledge can do
something on the resources. Any resource that is referenced by an URL
but known externally by some other key ought to be
"lookup-able" by key to get the URL. This is true for most
resources already.

In the meantime, I'll try the email tag trick suggested by Patrick:
rtc_cm


The e-mail tag was a possible proposal for a future solution. It is not
implemented.
The link to get the user information using the email address works,
however.

If you are willing to do some path math and you have the userId, this
works, too:
https://localhost:9443/jazz/oslc/users/


--
Regards,
Patrick
Jazz Work Item Team

permanent link
Sky Matthews (3632) | answered Sep 18 '09, 12:12 p.m.
Thanks Patrick,

I just discovered that it wasn't implemented yet and was about to post about that. I'll try one of your other suggested methods.

-Sky



The e-mail tag was a possible proposal for a future solution. It is not
implemented.
The link to get the user information using the email address works,
however.

If you are willing to do some path math and you have the userId, this
works, too:
https://localhost:9443/jazz/oslc/users/


--
Regards,
Patrick
Jazz Work Item Team

Your answer


Register or to post your answer.