Getting a person's user ID in ActivitiesAdded by IBM | Edited by IBM on December 14, 2012 | Version 6 (Show original)
|One of the parameters you can use to search activities is by a person's user ID. In fact, you must use this parameter instead of a person's email address in configurations in which email addresses are prevented from being displayed. But, how do you get a person's user ID?
Before you begin
If you have the Profiles installed, the quickest way to get a person's user ID is to perform a profiles search by name. The feed that is returned contains one entry for each person in the directory that has that name. The entry identifies the user ID of the person in the <snx:userid> element. To perform a search of profiles by name, use the following resource:
<profiles_server>/atom/search.do?name=<Last Name or First Name>
See Searching Profiles
for more information.
About this task
If you do not have Profiles installed or cannot access Profiles data programmatically, you can also retrieve a person's user ID from the member list of an activity that you share with the person. To do so, complete the following steps:
Parent topic: Getting Activities feeds
Searching Profiles programmatically
Searching the My Activities view
- Get the href of the activity that you share with the person by retrieving all of your activities. Use the following resource to retrieve the activities in your My Activities view:
If you can add a parameter to narrow down the results but still return the activity that you share with the person and to which she has contributed an entry, add it to narrow the search. For more information, see Searching the My Activities view
- In the feed returned, find the activity that you and the person share in common. Retrieve the member list of that activity by sending a GET request to the web address specified in the href attribute of the <link> element that has the rel="http://www.ibm.com/xmlns/prod/sn/member-list" attribute value.
- From the content returned, find the entry that contains the person's name. The person's user ID is specified in the associated <snx:userid> element.