Create a community blog programmaticallyTo create a community blog, send a POST request to the remote applications feed of the community to which you want to add the blog.
Before you beginYou cannot add a blog to a community programmatically until the Blog 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 the blog is available from the remote applications feed.
See Authenticating requests for information about how to authenticate the request.
- Determine the URI to which to POST the blog Atom document to create the community blog by first accessing the service document for remote applications. See Retrieve a remote applications list for more details.
- Create an Atom document to represent the community blog.
- Send the Atom document using a POST request to the following URI:
Table 1. Atom API request details
Method Resource URI Input representation POST Communities remote applications feed Value of the href attribute in the <link> element that has the rel="http://www.ibm.com/xmlns/prod/sn/remote-application/publish" attribute for the entry with the Blog category in the remote applications Atom document of the community to which you want to add the blog. blog definition
InputProvide an Atom entry document that contains the blog's definition entry as the post data. The content type must be "application/atom+xml".
Returned HTTP headers
HTTP/1.1 201 Created
Indicates that the blog was successfully created. If an error occurs, this header contains one of the error codes.
- HTTP/1.1 400 Bad Request
- HTTP/1.1 401 Unauthorized
Parent topicWork with remote applications
Work with blogs
Retrieve a remote applications list