Community articleCreating forums programmatically
Added by IBM contributorIBM on June 27, 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 stand-alone forum, send an Atom entry document containing the forum entry document to the root collection resource.



To create a stand-alone forum, send an Atom entry document containing the forum entry document to the root collection resource.

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

If you want to add some tags to this forum. For each tag, add the <category term="tag name"/> element to the forum entry document that you pass in on the request.
 
Input
Method URI Description
POST /forums/atom/forums Found in the href attribute of the forums root <collection> element in the Forums service document.
Content Type: application/atom+xml
Sample Request:
	<entry xmlns="http://www.w3.org/2005/Atom">

	<title type="text">Test Forum Sub Forum 1</title>

	<content type="text">Forum Sub Forum Test 1</content>

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

	</entry>
Output
Content Type: application/atom+xml
Name Type Optional Description
Location
string No Link to edit_url of the forum topic. You can use the web address specified here to subsequently retrieve and update the forum topic.
Code Description
201
Indicates that the forum was successfully created. If an error occurs, this header contains one of the error codes.
400
Bad Request.
401
Unauthorized.
Examples
POST /forums/atom/forums HTTP/1.1

	Host: www.dulcinea.com

	Content-Type: application/atom+xml

	Authorization: xxx

	Content-Length: nnn

	

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

	<title type="text">Test Forum Sub Forum 1</title>

	<content type="text">Forum Sub Forum Test 1</content>

	<updated>2010-08-04T13:36:18.841Z</updated>

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

	</entry>


Response returned by the server
HTTP/1.1 201 Created

	Date: Mon, 11 Jun 2007 20:07:13 GMT

	Content-Length: nnn

	Content-Type: application/atom+xml; charset="utf-8"

	Location: http://www.dulcinea.com/forums/atom/forums

	

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

	<id>urn:lsid:ibm.com:forum:e1b8faff-afc7-4ba8-9269-05bfd592efc7</id>

	<title type="text">Test Forum Sub Forum 1</title>

	<published>2010-08-04T21:32:49.731Z</published>

	<updated>2010-08-04T21:32:49.731Z</updated>

	<author>

	<email>jdoe@literature.com</email>

	<name>Jane Doe</name>

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

	772A006E-0A01-8703-8525-7346003DAFD6

	</snx:userid>

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

	</author>

	<link

	href="https://www.dulcinea.com/forums/atom/entries?forumUuid=e1b8faff-afc7-4ba8-9269-05bfd592efc7"

	rel="self"

	type="application/atom+xml">

	</link>

	<link

	href="https://www.dulcinea.com/forums/atom/forum?forumUuid=e1b8faff-afc7-4ba8-9269-05bfd592efc7"

	rel="edit"

	type="application/atom+xml">

	</link>

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

	<link href="https://www.dulcinea.com/forums/html/forum?id=e1b8faff-afc7-4ba8-9269-05bfd592efc7"

	rel="alternate"

	type="text/html">

	</link>

	<link

	xmlns:thr="http://purl.org/syndication/thread/1.0"

	href="https://www.dulcinea.com/forums/atom/topics?forumUuid=e1b8faff-afc7-4ba8-9269-05bfd592efc7"

	rel="replies"

	type="application/atom+xml"

	thr:count="0">

	</link>

	<link

	href="https://www.dulcinea.com/forums/atom/service?forumUuid=e1b8faff-afc7-4ba8-9269-05bfd592efc7"

	rel="service"

	type="application/atomsvc+xml"

	title="Atom Publishing Protocol">

	</link>

	<thr:in-reply-to

	xmlns:thr="http://purl.org/syndication/thread/1.0"

	href="https://www.dulcinea.com/forums/atom/forums"

	ref="https://www.dulcinea.com/forums/atom/forums"

	type="application/atom+xml">

	</thr:in-reply-to>

	<content type="html">Forum Sub Forum Test 1</content>

	</entry>