How to retrieve IBM connections user id for a profile using Profiles API in JAVA?

StackOverflow https://stackoverflow.com/questions/18923850

  •  29-06-2022
  •  | 
  •  

Question

I am new to IBM SBT and need some help to fetch the userid for a profile based on first name, last name or email id from the IBM connections profiles API.

I am planning to do a post on the activity stream on behalf of someone else and I need the user id of this someone else so that I can do a post on his behalf.

Any help is highly appreciated.

Was it helpful?

Solution

This returns the IBM Connections user's UUID:

ProfileService profileService = new ProfileService();
connectionsUuid = profileService.getProfile(emailAddress).getId();

If the String emailAddress contains an @, it searches by email address, otherwise, it searches by username, so these would return the same UUID for the IBM persona "Frank Adams":

connectionsUuid = profileService.getProfile("fadams@demos.ibm.com").getId();
connectionsUuid = profileService.getProfile("fadams").getId();
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top