ibm-connectionsibm-sbt

Retrieve tags from user profile in IBM Connections using Social Business Toolkit does not give tags


Hi we want to add tags to a userprofile programmatically. We are using the Social Business Toolkit for this purpose. More specifically we use the ProfileService, first we need to get the current tags and this always gives 0 results.

String userEmail = "ABC@XYZ.com";

            Map<String, String> params = new HashMap<String, String>();
            EntityList<Tag> tags = app.profileService.getTags(userEmail, params);

or

EntityList<Tag> tags = app.profileService.getTags("427ffbb1-ab50-4e82-97b2-46bf5584e799");

both give no tags (tags.size == 0) when we try to print them

if (tags.size() <= 0) {
                System.out.println("No tags to be displayed");
            }
            for (Tag tag : tags) {
                System.out.println("Tag : " + tag.getTerm());
                System.out.println("Tag Frequency:  " + tag.getFrequency());
                System.out.println("Tag Visibility : "
                        + tag.isVisible());
                System.out.println("");
            }

I have tried to test this with Connections Cloud and Greenhouse , but for those platforms I get authorization errors.
I tried this both with a 4.5 and 5.0 Connections environment, both giving the same result. However when I use the URL

profiles/atom/profileTags.do?targetEmail=ABC%40YYZ.com  

I do get (XML) results.

We are using version 1.1.9.


Solution

  • On both environments, you need to use the key to access a user's tags. https://apps.na.collabserv.com/profiles/atom/profileTags.do?targetKey=fb4435f4-f67d-4f4e-b905-669a31445d0f

    You can get the key from the service document. http://www-10.lotus.com/ldd/appdevwiki.nsf/xpAPIViewer.xsp?lookupName=API+Reference#action=openDocument&res_title=Retrieving_the_Profiles_service_document_ic50&content=apicontent

    Those two environments do not use targetEmail.

    Thanks

    Paul