Community articleCreating community activities
Added by IBM contributorIBM on March 18, 2014
Rate this article 1 starsRate this article 2 starsRate this article 3 starsRate this article 4 starsRate this article 5 stars

To create a community activity, send a POST request to the remote applications feed of the community to which you want to add the activity.
Tags: commapi



To create a community activity, send a POST request to the remote applications feed of the community to which you want to add the activity.

Before you begin

You cannot add activities to a community programmatically until the Activities widget has been added to the community using the Customize menu option in the product user interface. It is not until the widget is explicitly added that the service document resource for activities is available from the remote applications feed.

See Authenticating requests for information about how to authenticate the request.

Input

Provide an Atom document that contains a category element that represents the community activity.

Note: The content type of the Atom entry document must be application/atom+xml.

Output

None.

After creating a community activity with a category of type of explicit_membership_community_activity, you can define the members of the community activity. See Creating a member for more details.

Input
Method URI Description
POST /activities/service/atom2/activities From the entry in the Communities remote application feed that contains the <category term="Activities" scheme="http://www.ibm.com/xmlns/prod/sn/type" /> element, find the value of the href attribute in the <link> element that has the rel="http://www.ibm.com/xmlns/prod/sn/remote-application/feed" attribute.
Content Type: application/atom+xml
Sample Request:
<?xml version="1.0" encoding="UTF-8"?>

<entry 

 xmlns="http://www.w3.org/2005/Atom" 

 xmlns:app="http://www.w3.org/2007/app" 

 xmlns:snx="http://www.ibm.com/xmlns/prod/sn">


        <category term="Activities" scheme="http://www.ibm.com/xmlns/prod/sn/type"></category>
        
        <title type="text">Activity1</title>
        <content type="text">Activity1</content>
        
        
        
        
      
    </entry>
Name Type Optional Description
commUuid
string No The UUID of the community you wish to create the activity in.
public
enumerated No Choose if public or not.
Authorized values:
  • yes
  • no
authenticate
enumerated No Choose whether to authenticate or not
Authorized values:
  • yes
  • no
Output
Name Type Optional Description
Location
string Yes Link to edit_url of the new community activity. You can use the web address specified here to subsequently update the community activity.
Code Description
201
Created. Indicates that the community activity was successfully created. If an error occurs, this header will contain one of the error codes below.
400
Bad Request.
403
Forbidden. Authorization failed.