Community articleActivity Stream Batch POST with RPC
Added by IBM contributorIBM on March 25, 2013
Rate this article 1 starsRate this article 2 starsRate this article 3 starsRate this article 4 starsRate this article 5 stars

No abstract provided.

Deprecated



This mechanism has specific RPC considerations that have been developed with Gadgets in mind. For this reason a separate, simpler Batch POST capability has been developed.

POSTing a simple batch request to the currently Authenticated user


Batch requests differ from typical requests in their data format and endpoint url. The endpoint url changes from .../rest/activitystreams/@me/@all to /rpc (e.g. http:///connections/opensocial/rpc) (Please note that .../basic/rpc and .../oauth/rpc/ context are also available). 

A sample data model is as follows:

 [
{
    "method" : "activitystreams.create",
    "params" : {
       "userId" : "@me",
       "groupId" : "@all",
       "appId":"@all",
       "activity":{"actor":{"id":"@me"},"title":"${share}", "content":"This event is my first <b> batch </b> entry","object":{"id":"A"},"generator":{"id":"An External Application"}}
    }
 },
{
    "method" : "activitystreams.create",
    "params" : {
       "userId" : "@me",
       "groupId" : "@all",
       "appId":"@all",
       "activity":{"actor":{"id":"@me"},"title":"${share}", "content":"This event is my second <b> batch </b> entry","object":{"id":"B"},"generator":{"id":"An External Application4"}}
    }
 }