1

I know we can microblog (ublog) to a community by sending JSON to this endpoint:

https://CONNECTIONSHOST/connections/opensocial/rest/**ublog**/urn:lsid:lconn.ibm.com:communities.community:cbcdf38a-8526-4610-a83a-9ed6744de6be/@all

We can also post JSON that contains embedded experience to the activitystream using this endpoint:

https://CONNECTIONSHOST/connections/opensocial/xxx/rest/**activitystreams**/@me/@all/@all

The documentation (http://www-10.lotus.com/ldd/appdevwiki.nsf/xpDocViewer.xsp?lookupName=IBM+Connections+4.5+API+Documentation#action=openDocument&res_title=Community_specific_feeds_ic45&content=pdcontent ) suggests that you can specify a community for the activitystream service, but when I post the embedded experience JSON to this endpoint:

https://CONNECTIONSHOST/connections/opensocial/xxx/rest/**activitystreams**/urn:lsid:lconn.ibm.com:communities.community:cbcdf38a-8526-4610-a83a-9ed6744de6be/@me/@all 

Than the update is just posted to the homepage (main activity stream).

When I post the embedded experience JSON to the ublog service, the embedded experience is not displayed just the basic content.

The question is how can I share an embedded experience with just the community ?

mpjjonker
  • 917
  • 1
  • 6
  • 28

1 Answers1

2

The basic requirements for posting to a stream is to replace the @me in the url with the id of the community, giving you something like the following -

https://<domain>/connections/opensocial/rest/activitystreams/urn:lsid:lconn.ibm.com:communities.community:[rest of community id]/@all/@all

There is a quick trick you can use to make sure you have the right URL. Just open up the community and (using Firebug or an equivalent) check the URL of the network request made when you select Recent Updates (it will be the request with @all in it). Remove everything after the '?' and this is the URL you need.

Some notes on posting to a Community

  1. You must be a member of the community (if it's not public)
  2. You must be the Actor in the event (unless you have admin privileges)
Bill Looby
  • 81
  • 2
  • Thanks Bill,but no luck posting JSON to this endpoint:///connections/opensocial/basic/rest/activitystreams/urn:lsid:lconn.ibm.com:communities.community:cbcdf38a-8526-4610-a83a-9ed6744de6be/@all/@all – mpjjonker Sep 08 '14 at 11:11
  • I used https://sdkdemo.swg.usma.ibm.com:444/connections/opensocial/basic/rest/activitystreams/urn:lsid:lconn.ibm.com:communities.community:c5de2ed9-f856-4000-8e53-aa8dc57a23f5/@all/@all?rollup=true&format=json with content-type application/json ... do you have an error code? – Paul Bastide Sep 09 '14 at 16:38
  • also some sample json { "actor": { "id": "@me" }, "verb": "post", "title": "${share}", "content":"This event is my firssdft entry", "object": { "summary": "First asdf Entry details", "objectType": "note2", "id": "objectid2", "displayName": "First entry", "url": "http://myurl.com/myid2" }, "openSocial": { "embed": { "gadget": "https://sdkdemo.swg.usma.ibm.com:444/connections/resources/web/com.ibm.social.ee/ConnectionsEE.xml", "context": { "title": "Re: Test Test" } } } } – Paul Bastide Sep 09 '14 at 16:48