A collection of methods related to the Blog API / Blog Posts API / Blog Authors API
Methods
-
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))
-
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))
-
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))
-
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))
-
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))
-
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))
-
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))
-
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))
-
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))
-
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))
-
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))
-
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))
-
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))
-
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))
-
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))
-
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))
-
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))
-
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))
-
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))
-
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))
-
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))
-
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))
-
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))
-
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))
-
Publish, unpublish, or schedule a post
Name Type Description postId
int publishAction
string One of
schedule-publish
orcancel-publish
Returns:
Type Description Promise Example
const hs = new HubspotClient(props); hs.blog.publishOrSchedulePost(postId, publishAction).then(response => console.log(response))
-
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))
-
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))
-
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))
-
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))
-
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))
-
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))
-
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))
-
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))