API > Handling the response



The default API response is a simple REST response providing an XML block with the requested information, the status of the request (success/failure), and a timestamp reflecting the freshness of the data - by default, requests are cached for two minutes at which point they are expired. This timestamp is in the format of the RFC 822 specification, which is also used for the pubDate value in the RSS 2.0 specification. An example result for the latest blogs:

<response status="ok" time="Wed, 13 Feb 2008 15:57:12 -0600">
    <blog_post>
        <blog_posts_id>1</blog_posts_id>
        <subject>asdasd</subject>
        <body>asdfasd</body>
    </blog_post>
    <blog_post>
       <blog_posts_id>2</blog_posts_id>
       <subject>xczxczxc</subject>
       <body>
              zxczxczxc
       </body>
</blog_post>
</response>
In the event of an error, the response indicates an error code, a message, the status, and a timestamp. An example:
<response status="failure" time="Wed, 13 Feb 2008 16:11:00 -0600">
    <error code=13>Invalid method! blogs.noMethod</error>
</response>