Create forums programmatically 

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.

Table 1. Atom API request details

Method Resource URI Input representation
POST forum Found in the href attribute of the forums root <collection> element in the Forums service document. forum


Input

Provide a forum Atom entry document.

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


Output

An Atom entry document containing the new forum.

Returned HTTP headers

HTTP/1.1 201 Created

Location: url

Error codes

Request:

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:

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>


Parent topic

Work with stand-alone forums


   

 

});

+

Search Tips   |   Advanced Search