Create a blog programmatically 

To create a blog, send an Atom entry document containing the blog definition to the URI specified in the collection element of the service document.

Provide authentication credentials for the user who will be the owner of the blog on the request. See Authenticating requests for information about how to authenticate the request.

Table 1. Atom API request details

Method Resource URI Input representation
POST User's My Blogs feed Value of the href attribute of the <collection> element that has the title My Blogs within the workspace that has the title Blogs in the user's service document. blog definition


Input

Provide an Atom entry document that contains the blog's definition entry as the post data. The content type must be "application/atom+xml".


Output

None.

Returned HTTP headers

HTTP/1.1 201 Created

Error codes


Example

Input

POST /blogs/homepage/api/blogs HTTP/1.1
Authorization: Basic ...
Host: blogs.enterprise.example.com
Content-type: application/atom+xml
 
<?xml version='1.0' encoding='UTF-8'?>
<entry xmlns:snx='http://www.ibm.com/xmlns/prod/sn' xmlns='http://www.w3.org/2005/Atom'>
  <title type='text'>Original Title</title>
  <category term='existing-tag'/>
  <snx:timezone>America/New_York</snx:timezone>
  <snx:handle>atomicbilltest</snx:handle>
</entry>

Response

HTTP/1.1 201 Created
Content-Type: application/atom+xml; type=entry
Location: https://blogs.enterprise.example.com/blogs/homepage/api/blogs/
 0c0fc393-2e36-4d0e-9c9f-d4cfd10bfa70
 
<?xml version='1.0'?>
<entry xmlns='http://www.w3.org/2005/Atom'>
  <id>urn:lsid:ibm.com:blogs:blog-0c0fc393-2e36-4d0e-9c9f-d4cfd10bfa70</id>
  <link 
   href='https://blogs.enterprise.example.com/blogs/atomicbilltest' 
   rel='alternate' 
   type='text/html'/>
  <link 
   href='https://blogs.enterprise.example.com/blogs/homepage/api/blogs/
    0c0fc393-2e36-4d0e-9c9f-d4cfd10bfa70' 
   rel='edit' 
   type='application/atom+xml'/>
  <title type='text'>Original Title</title>
  <summary type='text'/>
  <updated>2008-05-20T14:09:32.296Z</updated>
  <app:edited 
   xmlns:app='http://www.w3.org/2007/app'>2008-05-20T14:09:32.296Z</app:edited>
  <published>2008-05-20T14:09:32.296Z</published>
  <snx:timezone 
   xmlns:snx='http://www.ibm.com/xmlns/prod/sn'>America/New_York</snx:timezone>
  <snx:locale xmlns:snx='http://www.ibm.com/xmlns/prod/sn'>en_US</snx:locale>
  <snx:handle 
   xmlns:snx='http://www.ibm.com/xmlns/prod/sn'>atomicbilltest</snx:handle>
  <author>
    <name>Bill User501</name>
    <email>buser501@example.com</email>
    <snx:userid>937965j0-4f0c-1028-5a06-db07163b51b2</snx:userid>
  </author>
  <category term='existing-tag'/>
</entry>


Parent topic

Work with blogs

Related reference
Blogs definition content


   

 

});

+

Search Tips   |   Advanced Search