Namespace: hs/blog

hs/blog

A collection of methods related to the Blog API / Blog Posts API / Blog Authors API

Methods

hs/blog.clonePost (opts)Promise asyncstatic

Clones a blog post

Name Type Description
opts object
Properties:
Name Type Description
opts.id int
opts.name string
Returns:
Type Description
Promise
Example
const hs = new HubspotClient(props);
hs.blog.clonePost(opts).then(response => console.log(response))

hs/blog.createComment (opts)Promise asyncstatic

Create a new comment.

Name Type Description
opts object
Properties:
Name Type Description
opts.comment string
opts.contentId int
opts.collectionId int
opts.contentAuthorEmail string
opts.contentAuthorName string
opts.contentPermalink string
opts.contentTitle string
opts.userEmail string
opts.userName string
opts.userUrl string
Returns:
Type Description
Promise
Example
const hs = new HubspotClient(props);
hs.blog.createComment(opts).then(response => console.log(response))

hs/blog.createOrUpdateAuthor (opts)Promise asyncstatic

Create or update a blog author info.

Name Type Description
opts object
Properties:
Name Type Description
opts.id int
opts.email string
opts.fullName string
opts.userId string
opts.username string
opts.bio string
opts.website string
opts.twitter string
opts.linkedin string
opts.facebook string
opts.googlePlus string
opts.avatar string
Returns:
Type Description
Promise
Example
const hs = new HubspotClient(props);
hs.blog.createOrUpdateAuthor(opts).then(response => console.log(response))

hs/blog.createOrUpdatePost (opts)Promise asyncstatic

Create or update a blog post.

Name Type Description
opts object
Properties:
Name Type Description
opts.id int
opts.archived boolean
opts.blog_author_id int
opts.campaign string
opts.campaign_name string
opts.content_group_id int
opts.state string
opts.featured_image string
opts.footer_html string
opts.head_html string
opts.keywords string
opts.meta_description string
opts.name string
opts.post_body string
opts.post_summary string
opts.publish_date int
opts.publish_immediately boolean
opts.slug string
opts.topic_ids array
opts.use_featured_image boolean
opts.widgets string
Returns:
Type Description
Promise
Example
const hs = new HubspotClient(props);
hs.blog.createOrUpdatePost(opts).then(response => console.log(response))

hs/blog.createOrUpdateTopic (opts)Promise asyncstatic

Create or update a blog topic.

Name Type Description
opts object
Properties:
Name Type Description
opts.id int
opts.name string
opts.description string
Returns:
Type Description
Promise
Example
const hs = new HubspotClient(props);
hs.blog.createOrUpdateTopic(opts).then(response => console.log(response))

hs/blog.deleteAuthor (id)Promise asyncstatic

Remove a blog author

Name Type Description
id int
Returns:
Type Description
Promise
Example
const hs = new HubspotClient(props);
hs.blog.deleteAuthor(id).then(response => console.log(response))

hs/blog.deleteComment (id)Promise asyncstatic

Remove a blog comment

Name Type Description
id int
Returns:
Type Description
Promise
Example
const hs = new HubspotClient(props);
hs.blog.deleteComment(id).then(response => console.log(response))

hs/blog.deletePost (id)Promise asyncstatic

Remove a blog post

Name Type Description
id int
Returns:
Type Description
Promise
Example
const hs = new HubspotClient(props);
hs.blog.deletePost(id).then(response => console.log(response))

hs/blog.deleteTopic (id)Promise asyncstatic

Remove a blog topic

Name Type Description
id int
Returns:
Type Description
Promise
Example
const hs = new HubspotClient(props);
hs.blog.deleteTopic(id).then(response => console.log(response))

hs/blog.getAllBlogs (opts)Promise asyncstatic

Get info for all blogs on a particular portal

Name Type Description
opts object
Properties:
Name Type Description
opts.name string
opts.limit int
opts.offset int
opts.created int
opts.deleted_at int
Returns:
Type Description
Promise
Example
const hs = new HubspotClient(props);
hs.blog.getAllBlogs(opts).then(response => console.log(response))

hs/blog.getAuthor (id)Promise asyncstatic

Retrieve blog author details

Name Type Description
id int
Returns:
Type Description
Promise
Example
const hs = new HubspotClient(props);
hs.blog.getAuthor(id).then(response => console.log(response))

hs/blog.getAuthors (opts)Promise asyncstatic

Retrieve all blog authors

Name Type Description
opts object
Properties:
Name Type Description
opts.email string
opts.limit int
opts.offset int
opts.id int
opts.fullName string
opts.slug string
opts.created int
opts.updated int
Returns:
Type Description
Promise
Example
const hs = new HubspotClient(props);
hs.blog.getAuthors(id).then(response => console.log(response))

hs/blog.getBlogById (id)Promise asyncstatic

Retrieve blog info for specific blog

Name Type Description
id int
Returns:
Type Description
Promise
Example
const hs = new HubspotClient(props);
hs.blog.getBlogById(id).then(response => console.log(response))

hs/blog.getComment (commentId)Promise asyncstatic

Get specific comment

Name Type Description
commentId int
Returns:
Type Description
Promise
Example
const hs = new HubspotClient(props);
hs.blog.getComment(commentId).then(response => console.log(response))

hs/blog.getComments (opts)Promise asyncstatic

Get all comments for specific content

Name Type Description
opts object
Properties:
Name Type Description
opts.limit int
opts.offset int
opts.portalId int
opts.state string
opts.contentId int
opts.reverse boolean
opts.query string
Returns:
Type Description
Promise
Example
const hs = new HubspotClient(props);
hs.blog.getComments(opts).then(response => console.log(response))

hs/blog.getPostAutosaveBuffer (postId)Promise asyncstatic

Retrieve blog post autosave buffer contents

Name Type Description
postId int
Returns:
Type Description
Promise
Example
const hs = new HubspotClient(props);
hs.blog.getPostAutosaveBuffer(postId).then(response => console.log(response))

hs/blog.getPostAutosaveBufferStatus (postId)Promise asyncstatic

Retrieve blog post autosave buffer status

Name Type Description
postId int
Returns:
Type Description
Promise
Example
const hs = new HubspotClient(props);
hs.blog.getPostAutosaveBufferStatus(postId).then(response => console.log(response))

hs/blog.getPostById (id)Promise asyncstatic

Retrieve blog post info by ID

Name Type Description
id int
Returns:
Type Description
Promise
Example
const hs = new HubspotClient(props);
hs.blog.getPostById(id).then(response => console.log(response))

hs/blog.getPosts (opts)Promise asyncstatic

Get all blog posts for specified blog

Name Type Description
opts object
Properties:
Name Type Description
opts.limit int
opts.offset int
opts.archived boolean
opts.blog_author_id int
opts.campaign string
opts.content_group_id int
opts.slug string
opts.state string
opts.order_by string
opts.created int
opts.deleted_at int
opts.name string
opts.updated boolean
Returns:
Type Description
Promise
Example
const hs = new HubspotClient(props);
hs.blog.getPosts(opts).then(response => console.log(response))

hs/blog.getPostVersionById (versionId)Promise asyncstatic

Retrieve blog post version

Name Type Description
versionId int
Returns:
Type Description
Promise
Example
const hs = new HubspotClient(props);
hs.blog.getPostVersionById(versionId).then(response => console.log(response))

hs/blog.getPostVersions (postId)Promise asyncstatic

Retrieve blog post versions by post ID

Name Type Description
postId int
Returns:
Type Description
Promise
Example
const hs = new HubspotClient(props);
hs.blog.getPostVersions(postId).then(response => console.log(response))

hs/blog.getTopic (id)Promise asyncstatic

Retrieve blog topic info

Name Type Description
id int
Returns:
Type Description
Promise
Example
const hs = new HubspotClient(props);
hs.blog.getTopic(id).then(response => console.log(response))

hs/blog.getTopics (opts)Promise asyncstatic

Retrieve blog topic info

Name Type Description
opts object
Properties:
Name Type Description
opts.id int
opts.name string
opts.created int
opts.slug string
opts.limit int
opts.offset int
Returns:
Type Description
Promise
Example
const hs = new HubspotClient(props);
hs.blog.getTopics(opts).then(response => console.log(response))

hs/blog.groupTopics (opts)Promise asyncstatic

Merge multiple topics by ID into a single topic group.

Name Type Description
opts object
Properties:
Name Type Description
opts.groupedTopicName string
opts.topicIds array.<int>
Returns:
Type Description
Promise
Example
const hs = new HubspotClient(props);
hs.blog.groupTopics(opts).then(response => console.log(response))

hs/blog.publishOrSchedulePost (postId, publishAction)Promise asyncstatic

Publish, unpublish, or schedule a post

Name Type Description
postId int
publishAction string

One of schedule-publish or cancel-publish

Returns:
Type Description
Promise
Example
const hs = new HubspotClient(props);
hs.blog.publishOrSchedulePost(postId, publishAction).then(response => console.log(response))

hs/blog.pushPostAutosaveBufferLive (postId)Promise asyncstatic

Push the autosave buffer for a post to live.

Name Type Description
postId int
Returns:
Type Description
Promise
Example
const hs = new HubspotClient(props);
hs.blog.pushPostAutosaveBufferLive(postId).then(response => console.log(response))

hs/blog.restoredDeletedPost (postId)Promise asyncstatic

Restore a previously deleted post

Name Type Description
postId int
Returns:
Type Description
Promise
Example
const hs = new HubspotClient(props);
hs.blog.restoredDeletedPost(postId).then(response => console.log(response))

hs/blog.restoreDeletedComment (id)Promise asyncstatic

Restore a deleted comment

Name Type Description
id int
Returns:
Type Description
Promise
Example
const hs = new HubspotClient(props);
hs.blog.restoreDeletedComment(opts).then(response => console.log(response))

hs/blog.restorePostVersionById (postId, versionId)Promise asyncstatic

Restore a post version to a specific ID.

Name Type Description
postId int
versionId int
Returns:
Type Description
Promise
Example
const hs = new HubspotClient(props);
hs.blog.restorePostVersionById(postId, versionId).then(response => console.log(response))

hs/blog.searchAuthors (opts)Promise asyncstatic

Search blog authors

Name Type Description
opts object
Properties:
Name Type Description
opts.order int
opts.limit int
opts.offset int
opts.q string

Free text search parameter

opts.active boolean
opts.blog int
Returns:
Type Description
Promise
Example
const hs = new HubspotClient(props);
hs.blog.searchAuthors(opts).then(response => console.log(response))

hs/blog.searchTopics (opts)Promise asyncstatic

Search blog topics

Name Type Description
opts object
Properties:
Name Type Description
opts.id int
opts.name string
opts.created int
opts.slug string
opts.limit int
opts.offset int
opts.q string

Free text search parameter

opts.active boolean
opts.blog int
Returns:
Type Description
Promise
Example
const hs = new HubspotClient(props);
hs.blog.searchTopics(opts).then(response => console.log(response))

hs/blog.updateAutosaveBuffer (opts)Promise asyncstatic

Update the autosave buffer for a post

Name Type Description
opts object
Properties:
Name Type Description
opts.id int
opts.blog_author_id int
opts.campaign string
opts.campaign_name string
opts.content_group_id int
opts.featured_image string
opts.footer_html string
opts.head_html string
opts.keywords string
opts.meta_description string
opts.name string
opts.post_body string
opts.post_summary string
opts.publish_date int
opts.publish_immediately boolean
opts.slug string
opts.topic_ids array
opts.use_featured_image boolean
opts.widgets string
Returns:
Type Description
Promise
Example
const hs = new HubspotClient(props);
hs.blog.updateAutosaveBuffer(opts).then(response => console.log(response))

hs/blog.validatePostAutosaveBufferStatus (postId)Promise asyncstatic

Validate the autosave buffer on a post.

Name Type Description
postId int
Returns:
Type Description
Promise
Example
const hs = new HubspotClient(props);
hs.blog.validatePostAutosaveBufferStatus(postId).then(response => console.log(response))