Blog API Methods

Get Blog Posts from a Specific Blog

GET  /blog/v1/:blog_guid/posts.:ext

For a given blog, as identified by its GUID, list blog posts. The default listing is for the ten most recent posts, in order from the most recently published backwards.

For each post, return key data about that post, such as the post GUID, human-friendly web viewing link, publication date / time, etc...

Required Parameters How to use Description
Blog GUID Used in the request URL Unique identifier for a particular blog you want to list posts from.
HubSpot OAuth Access Token access_token=X - Used in the request URL The HubSpot API key for the portal that you're making the call for.
Optional Parameters How to use Description
Max &max=X - Used in the request URL The maximum number of comments to return from the blog post.
Offset &offset=X - Used in the request URL By default, this call will return a max of 10 blog posts per page. You can use this "offset" parameter to get more posts. For instance, if you want to return posts 11-20, you should pass an "offset=10" parameter to your call.

Example URL requesting JSON:  https://api.hubapi.com/blog/v1/0d61e4ca-e395-4c1c-8766-afaa48bf68db/posts.json?access_token=demooooo-oooo-oooo-oooo-oooooooooooo&max=1

Example JSON output. It lists one post from a blog:

        [
            {
                "authorDisplayName": "testapi@hubspot.com",
                "authorEmail": "testapi@hubspot.com",
                "blogGuid": "0d61e4ca-e395-4c1c-8766-afaa48bf68db",
                "body": "this is the content for testing hapihp",
                "createTimestamp": 1322620803000,
                "draft": true,
                "guid": "512e6339-7773-4a11-ab81-a9cb7846b9aa",
                "jsonUrl": "https://api.hubapi.com/blog/v1/posts/512e6339-7773-4a11-ab81-a9cb7846b9aa.json",
                "lastUpdateTimestamp": 1322620803000,
                "metaDescription": "",
                "metaKeywords": "",
                "portalId": 62515,
                "postAnalytics": null,
                "publishTimestamp": 1322620803000,
                "sendNotifications": true,
                "summary": "testing hapihp summary",
                "tags": [
                    "hapihp tag 2",
                    "hapihp tag 1"
                ],
                "title": "find this one",
                "url": "http://demo.hubapi.com/blog-for-testing/bid/80157/"
            }
        ]
    

Example URL requesting AtomPub:  https://api.hubapi.com/blog/v1/0d61e4ca-e395-4c1c-8766-afaa48bf68db/posts.atom?access_token=demooooo-oooo-oooo-oooo-oooooooooooo&max=1

Example AtomPub Output:

        <?xml version="1.0" encoding="UTF-8"?>
        <feed xmlns="http://www.w3.org/2005/Atom">
            <id>0d61e4ca-e395-4c1c-8766-afaa48bf68db</id>
            <title type="text">Test Blog (content from customers.hubspot.com)</title>
            <entry xmlns:hs="http://www.hubspot.com/">
                <id>512e6339-7773-4a11-ab81-a9cb7846b9aa</id>
                <title type="text">find this one</title>
                <summary type="text">testing hapihp summary</summary>
                <content type="html">this is the content for testing hapihp</content>
                <author>
                    <name>testapi@hubspot.com</name>
                    <email>testapi@hubspot.com</email>
                </author>
                <link href="http://demo.hubapi.com/blog-for-testing/bid/80157/" />
                <updated>2011-11-30T02:40:03.000Z</updated>
                <published>2011-11-30T02:40:03.000Z</published>
                <hs:portalId>62515</hs:portalId>
                <hs:blogGuid>0d61e4ca-e395-4c1c-8766-afaa48bf68db</hs:blogGuid>
                <hs:metaDescription />
                <hs:metaKeywords />
                <hs:draft>true</hs:draft>
                <hs:sendNotifications>true</hs:sendNotifications>
                <category term="hapihp tag 2" />
                <category term="hapihp tag 1" /><hs:postAnalytics />
            </entry>
        </feed>