Blog API Methods

Create a New Blog Comment

POST  /blog/v1/:post_guid/comments.atom

For a given blog, as identified by its GUID, create a new blog comment.

This request expects one element in the request body, an AtomPub-formatted XML snippet that is the new post. Your request Content-Type header must be application/atom+xml and your request method must be POST.

Please note that there will be slight delay from the time that you make this API call to create a comment, to the time that the comment shows up in the HubSpot user interface.

Required Parameters How to use Description
Post GUID Used in the request URL Unique identifier for the particular blog post that you're creating a comment for.
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.
Author Name <name> - Used in the request body The name of the author for the comment you're creating
Author Email <email> - Used in the request body The comment author's email address
Author URL <uri> - Used in the request body The comment author's website
Content <content> - Used in the request body The comment content. This can be pain text or HTML. See sample request body below for an example.
Optional Parameters How to use Description
None None No optional parameters for this method.

Example URL:  https://api.hubapi.com/blog/v1/ae15391a-7bd9-454d-b51b-5c480a010497/comments.atom?access_token=demooooo-oooo-oooo-oooo-oooooooooooo

Example AtomPub request body for this API call:

        <?xml version="1.0" encoding="utf-8"?>
        <entry xmlns="http://www.w3.org/2005/Atom">
            <author>
                <name>Test comment Author</name>
                <email>hapihp@hs.com</email>
                <uri>http://hubspot.com</uri>
            </author>
            <content><![CDATA[test comment created now]]></content>
        </entry>
    

The response from this API call are standard REST-style HTTP response codes that mark success or failure, with meta information about the call that was made.

  • 201 Created - For a successful call, meaning a new comment has been created. The response body will be the created object with the id fields populated, as seen below.
  • >= 400 Error for any sort of error.

Example response header for this API call:

        HTTP/1.1 201 Created
        Date: Tue, 06 Dec 2011 23:55:45 GMT
        Server: Apache-Coyote/1.1
        Content-Type: application/atom+xml;charset=UTF-8
        Connection: close
        Transfer-Encoding: chunked
    

Example response body for this API call:

        <?xml version="1.0" encoding="UTF-8"?>
        <feed xmlns="http://www.w3.org/2005/Atom">
            <id>ae15391a-7bd9-454d-b51b-5c480a010497</id>
            <title type="text">new improves Updated title</title>
            <author>
                <name>testapi@hubspot.com</name>
                <email>testapi@hubspot.com</email>
            </author>
            <entry xmlns:hs="http://www.hubspot.com/">
                <id>e44463f2-76a4-4438-951f-627d5d15f62b</id>
                <author>
                    <name>Test comment Author</name>
                    <email>hapihp@hs.com</email>
                    <uri>http://hubspot.com</uri>
                </author>
                <content type="text">test comment created now</content>
                <published>2011-12-06T23:55:44.000Z</published>
                <hs:blogGuid>0d61e4ca-e395-4c1c-8766-afaa48bf68db</hs:blogGuid>
                <hs:postGuid>ae15391a-7bd9-454d-b51b-5c480a010497</hs:postGuid>
                <hs:userToken></hs:userToken>
                <hs:judgeScoredTimestamp></hs:judgeScoredTimestamp>
                <hs:judgeIsSpam>false</hs:judgeIsSpam>
            </entry>
        </feed>