Live Blog API Tutorial

You can send GET requests for information to a Live Blog instance without needing to authenticate first. Responses are XML format by default, and are a combination of links to more information and text surrounded by markup.

In this example we request a complete list of Blogs hosted at the demo Live Blog server, decide which one we want from the title of the Blog, and then request all of the posts from that Blog.

  1. Get the list of Blogs from server:

    GET http://doc.sd-demo.sourcefabric.org/resources/LiveDesk/Blog
    
    <?xml version="1.0" encoding="UTF-8"?>
    <BlogList total="5" limit="5" offset="0">
        <Blog href="http://doc.sd-demo.sourcefabric.org/resources/LiveDesk/Blog/1"/>
        <Blog href="http://doc.sd-demo.sourcefabric.org/resources/LiveDesk/Blog/2"/>
        <Blog href="http://doc.sd-demo.sourcefabric.org/resources/LiveDesk/Blog/3"/>
        <Blog href="http://doc.sd-demo.sourcefabric.org/resources/LiveDesk/Blog/4"/>
        <Blog href="http://doc.sd-demo.sourcefabric.org/resources/LiveDesk/Blog/5"/>
    </BlogList>
    
  2. For each of these five Blogs, follow the link for information about the blog:

    GET http://doc.sd-demo.sourcefabric.org/resources/LiveDesk/Blog/1
    GET http://doc.sd-demo.sourcefabric.org/resources/LiveDesk/Blog/2
    GET http://doc.sd-demo.sourcefabric.org/resources/LiveDesk/Blog/3
    GET http://doc.sd-demo.sourcefabric.org/resources/LiveDesk/Blog/4
    GET http://doc.sd-demo.sourcefabric.org/resources/LiveDesk/Blog/5
    

    Excerpt response from Blog 5:

    <?xml version="1.0" encoding="UTF-8"?>
    <Blog>
      <Id>5</Id>
      <IsLive>False</IsLive>
      <Description>The testing description</Description>
      <Title>The testing test</Title>
      <CreatedOn>10/4/13 12:58 PM</CreatedOn>
    

    Excerpt response from Blog 4:

    <?xml version="1.0" encoding="UTF-8"?>
    <Blog>
      <Id>4</Id>
      <IsLive>False</IsLive>
      <Description>&lt;span class="placeholder"&gt;and some description&lt;span style="display: none;" sel-id="sel-1373981816301-18497082770598405"&gt;&lt;/span&gt;&lt;/span&gt;</Description>
      <Title>Test live blog to reproduce duplication of republished wrap-up posts</Title>
      <CreatedOn>7/15/13 4:58 PM</CreatedOn>
    

    ...

  3. Decide that we want to get posts from “Test live blog to reproduce duplication of republished wrap-up posts”, which we know is Blog 4:

    GET http://doc.sd-demo.sourcefabric.org/resources/LiveDesk/Blog/4/Post/Published
    
    <?xml version="1.0" encoding="UTF-8"?>
    <PostList offsetMore="2" total="2" limit="2" lastCId="191" offset="0">
      <Post href="http://doc.sd-demo.sourcefabric.org/resources/LiveDesk/Blog/4/Post/73"/>
      <Post href="http://doc.sd-demo.sourcefabric.org/resources/LiveDesk/Blog/4/Post/72"/>
    </PostList>
    

    Note that we are only requesting Published posts here, to get Draft posts also ommit /Published from the URL.

  4. Follow each link for details of each post:

    GET http://doc.sd-demo.sourcefabric.org/resources/LiveDesk/Blog/4/Post/72
    
    <?xml version="1.0" encoding="UTF-8"?>
    <Post>
      <Id>72</Id>
      <IsModified>False</IsModified>
      <IsPublished>True</IsPublished>
      <CId>186</CId>
      <Order>30.0</Order>
      <AuthorName>Janet Editor</AuthorName>
      <Content>test</Content>
      <Meta>{}</Meta>
      <CreatedOn>7/16/13 12:50 PM</CreatedOn>
      <PublishedOn>7/16/13 12:50 PM</PublishedOn>
      <Author href="http://doc.sd-demo.sourcefabric.org/resources/Data/Collaborator/10">
        <Id>10</Id>
      </Author>
      <AuthorPerson href="http://doc.sd-demo.sourcefabric.org/resources/HR/Person/2">
        <Id>2</Id>
      </AuthorPerson>
      <Blog href="http://doc.sd-demo.sourcefabric.org/resources/LiveDesk/Blog/4">
        <Id>4</Id>
      </Blog>
      <Creator href="http://doc.sd-demo.sourcefabric.org/resources/HR/User/2">
        <Id>2</Id>
      </Creator>
      <Type href="http://doc.sd-demo.sourcefabric.org/resources/Data/PostType/wrapup">
        <Key>wrapup</Key>
      </Type>
    </Post>
    
  5. Complete the information about the Author, Type of Blog post, etc by following the links in the response.

See Resources for more information.