user2800401
user2800401

Reputation: 13

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

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

Answers (1)

dvdsmpsn
dvdsmpsn

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

Related Questions