Reputation: 13
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.
Upvotes: 1
Views: 993
Reputation: 2869
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("[email protected]").getId();
connectionsUuid = profileService.getProfile("fadams").getId();
Upvotes: 3