Search code examples
ibm-connectionsibm-sbt

IBM Connections API call to join a community


In my current project, a user logged in to our third-party tool writes a message, which will then be posted to a community blog in IBM Connections via its REST API.

To be able to write a blog entry, said user has to be a member of that (public) community. On the Connections UI, the user can just click on "join this community", but does the IBM SBT (or even the rest API itself) contain this functionality as well?

As I saw, there are requests to add members to the community, but they can only be made as the community owner (which I dont know in the given context). The API documentation also mentions creating "requests to join" which is also not really feasible in this situation.

Is there any way to achieve what I'm trying to do?

EDIT: I just looked at the request that the UI "join this community" Button sends to the connections server. It sadly is not part of the REST API.


Solution

  • You should reference the Community Service https://github.com/OpenNTF/SocialSDK/blob/master/sdk/com.ibm.sbt.core/src/main/java/com/ibm/sbt/services/client/connections/communities/Community.java

    This Method...

    public boolean addMember(Member member) throws CommunityServiceException
        {
    return getService().addMember(getCommunityUuid(), member);
        }
    

    Examples are here. https://greenhouse.lotus.com/sbt/SBTPlayground.nsf/JavaScriptSnippets.xsp#snippet=Social_Communities_API_AddMember

    These snippets should resolve your issues.

    You can use this API...

    You can get the Raw XML and process http://www-10.lotus.com/ldd/appdevwiki.nsf/xpDocViewer.xsp?lookupName=IBM+Connections+4.5+API+Documentation#action=openDocument&res_title=Creating_a_request_to_join_a_community_ic45&content=pdcontent

    or https://greenhouse.lotus.com/sbt/SBTPlayground.nsf/JavaSnippets.xsp#snippet=Social_Communities_Create_Invite