Community articleCreating subcommunities programmatically
Added by IBM contributorIBM on March 14, 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 subcommunity, send an Atom entry document containing the new subcommunity to the My Communities resource.
Tags: commapi



To create a subcommunity, send an Atom entry document containing the new subcommunity to the My Communities resource.

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

Input

Provide a subcommunity Atom entry document. A subcommunity is the same as a community entry, but contains a rel="http://www.ibm.com/xmlns/prod/sn/parentcommunity" <link> element. The content type of the Atom entry document must be application/atom+xml.

Output

An Atom entry document containing the new subcommunity entry.

Input
Method URI Description
POST /communities/service/atom/community/subcommunities In the My Communities{{{ feed, find the value of the href attribute of the <link> element for the community to which you want to add the subcommunity that has the rel="}}}{{{http}}}{{{://www.ibm.com/xmlns/prod/sn/subcommunities" 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">

<id>ignored</id>

<title type="text">SubSubSub</title>

<content type="html">Share information about day care.</content>

<category term="community" scheme="http://www.ibm.com/xmlns/prod/sn/type"></category>

<link href="https://greenhousestage.lotus.com/communities/service/atom/community/subcommunities?communityUuid=050c03c9-e062-4804-a6fc-0462c880fcaf" rel="http://www.ibm.com/xmlns/prod/sn/subcommunities" type="application/atom+xml"></link>

<snx:communityType>public</snx:communityType>

</entry>
Name Type Optional Description
communityUuid
string No The UUID of the community you wish to create the subcommunity in.
Output
Content Type: application/atom+xml
Name Type Optional Description
Location
string No Link to edit_url of the new subcommunity entry. You can use the web address specified here to subsequently retrieve and update the subcommunity entry.
Code Description
201
Indicates that the subcommunity was successfully created. If an error occurs, this header contains one of the error codes.
400
Bad Request.
401
Unauthorized. Returned when no authenticated user or no userid, email, or key parameter are provided on the request.