It's all about the answers!

Ask a question

Quering User by userId using REST API


Michele Pegoraro (1.8k14119103) | asked Oct 21 '11, 3:58 a.m.
Hi,
I was looking for a way to retrieve an user through REST API using his userId.

If I search a user with his name it works correctly with this command:

curl -k -L -b cookies.txt "http://myurl/ccm/oslc/users.json?oslc_cm.query=dc:title=%22TechUser%22%20&oslc_cm.properties=dc:title,rdf:resource,rtc_cm:userId"


and it also runs if I'm searching for the e-mail address:

curl -k -L -b cookies.txt "http://myurl/ccm/oslc/users.json?oslc_cm.query=rtc_cm:emailAddress=%22TechUser@email.me%22%20&oslc_cm.properties=dc:title,rdf:resource,rtc_cm:userId"


But if I try using rtc_cm:userId

curl -k -L -b cookies.txt "http://myurl/ccm/oslc/users.json?oslc_cm.query=rtc_cm:userId=%22TechUser%22%20&oslc_cm.properties=dc:title,rdf:resource,rtc_cm:userId"


I get a 400 error which says that userId is an unknown attribute ID.

How can I run this query?

Thanks,
Michele.

One answer



permanent link
Michele Pegoraro (1.8k14119103) | answered Jun 22 '12, 6:18 a.m.
If I cannot use a query to find the user I have to retrieve all the users. And with a lot of user I've find out that my result is truncated: not all the users are extracted and no error or warning has been returned to inform of this truncation.

If it is not possible to do a query by userId is it possible to extend the max result number?

Thanks,
Michele.

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.