cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
217
Views
0
Helpful
0
Comments
cdnadmin
Level 11
Level 11
This document was generated from CDN thread

Created by: Matt Farmer on 14-05-2013 06:40:51 AM
Hi.  Im making good progress with the API, but having trouble on a seemingly simple thing.
Is it possible to get a full list of users via the API?  
I can lookup individual users by screen name or ID, but can't get a full list from /users.  I also tried wildcards in the email address etc.  
An example use case I have is to build a report of how many communities each user in the system belongs to.  I do seem to have permission to do this for arbitrary users - it's just getting the IDs.  
Thanks!

Subject: RE: Get list of users
Replied by: Adrienne Moherek on 14-05-2013 11:08:11 AM
Hi Matt,

Try this URL:
http://<server>/api/quad/rest/search/@users?q=*&filterBy=user&filterValue=user_id
 
Thanks,
Adrienne

Subject: RE: Get list of users
Replied by: Matt Farmer on 15-05-2013 09:09:41 AM
Thanks for the hint, though Im afraid I cant see anything about users via the search API.
 
I tried the above, and also variations of the following.  (I don't believe I need the filterBy values on the end that you used as I am looking for a full dump of users.) 
http://192.168.10.129/api/quad/rest/search/@users
http://192.168.10.129/api/quad/rest/search/@users?q=userId:*                                                                                                                                    
http://192.168.10.129/api/quad/rest/search/@users?q=emailAddress:*@test_company.com   
 
I'm logged in as test@test_company.com on the dev virtual machine via OAuth.  I've given that user full permissions to view other users via the GUI but no joy. 
Any help appreciated!
 
PS here is the empty response I receive when trying to query for users:
{"feed":{"author":{"name":"http://quad.cisco.com"},"title":{"content":"http://quad.cisco.com OpenSearch","type":"text"},"updated":"2013-05-15T14:05:04.767Z","xmlns":"http://www.w3.org/2005/At
om"}}    
 
 
vs this when I search for informations:
{"feed":{"author":{"name":"http://quad.cisco.com"},"title":{"content":"http://quad.cisco.com OpenSearch","type":"text"},"updated":"2013-05-15T14:03:37.519Z","entry":{"summary":{"content":"Yes\
, this is a really nice <em>product<\/em>.  ","type":"text"},"id":"100001","author":{"cisco:resource":"http://quad.cisco.com/schema/1.0/user","cisco:id":"10261","uri":"/users"},"category":{"t\
erm":"information"},"title":{"content":"Congratulations to the team...","type":"text"},"cisco:resource":"http://quad.cisco.com/schema/1.0/post","updated":"2013-05-12T12:54:02.000Z","cisco:sco\
re":"1.0","link":{"href":"/posts/100001"},"xmlns:cisco":"http://quad.cisco.com","published":"2013-05-12T12:54:02.000Z"},"xmlns":"http://www.w3.org/2005/Atom"}}

Subject: RE: Get list of users
Replied by: Adrienne Moherek on 15-05-2013 10:29:42 AM
Hi Matt,

Have you created users and logged in as each user to accept the terms and conditions?
Thanks,
Adrienne

Subject: RE: Get list of users
Replied by: Matt Farmer on 15-05-2013 04:00:12 PM
OK I'm a bit further, thanks.
I can see that I can query only the users that the 'request token authorising' user has *created*.
Should the query method http://192.168.11.22/api/quad/rest/search/@users?q=* return all users in the system?
Is there a god user who is at the top of the tree?  I tried all of the included accounts and none of them seem to have visibility of the full set or the other pre-created accounts.
Thanks again.  Everything else in the API is working great, it's just this one thing!

Subject: RE: Get list of users
Replied by: Adrienne Moherek on 16-05-2013 10:54:58 AM
Hi Matt,

I was going through the API reference guide and found this:
Use an asterisk (*) anywhere except as the first character in a single word or string to represent any sequence of characters.
This would explain why q=* will not work.

Let me check with the team to find an alternative.

Thanks,

Adrienne

Subject: RE: Get list of users
Replied by: Adrienne Moherek on 16-05-2013 02:22:31 PM
Hi Matt,
This should do the trick: http://<server>/api/quad/rest/search/@users?q=
You will then have to get all communities associated with that user.
Thanks, Adrienne
Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community:

Quick Links