A collection of methods related to the Page Publishing API
Methods
-
Clones a page
Name Type Description id
int Returns:
Type Description Promise Example
const hs = new HubspotClient(props); hs.pages.clonePage(id).then(response => console.log(response))
-
Create a new page or update an existing page
Name Type Description opts
object Properties:
Name Type Description opts.id
int If set, this will update the page with the corresponding ID.
opts.campaign
string opts.campaign_name
string opts.state
string opts.footer_html
string opts.head_html
string opts.is_draft
string opts.meta_description
string opts.meta_keywords
string opts.name
string opts.password
string opts.publish_date
long opts.publish_immediately
string opts.slug
string opts.subcategory
string opts.widget_containers
string opts.widgets
string Returns:
Type Description Promise Example
const hs = new HubspotClient(props); hs.pages.createOrUpdatePage(opts).then(response => console.log(response));
-
Remove a page
Name Type Description id
int Returns:
Type Description Promise Example
const hs = new HubspotClient(props); hs.pages.deletePage(id).then(response => console.log(response))
-
Carries out a publish action with the current page. Check out the developer docs for further info.
Name Type Description pageId
int publishAction
string One of
push-buffer-live
,schedule-publish
orcancel-publish
Returns:
Type Description Promise Example
const hs = new HubspotClient(props); hs.pages.doPublishAction(pageId, publishAction).then(response => console.log(response))
-
Retrieve page autosave buffer contents
Name Type Description pageId
int Returns:
Type Description Promise Example
const hs = new HubspotClient(props); hs.pages.getPageAutosaveBuffer(pageId).then(response => console.log(response))
-
Retrieve page info by ID
Name Type Description id
int Returns:
Type Description Promise Example
const hs = new HubspotClient(props); hs.pages.getPageById(id).then(response => console.log(response))
-
Get a collection of pages
Name Type Description opts
object Properties:
Name Type Description opts.limit
string opts.offset
string opts.ab_test_id
string opts.archived
boolean opts.campaign
string opts.created
string opts.deleted_at
string opts.id
int opts.is_draft
boolean opts.name
string opts.publish_date
long opts.slug
string opts.subcategory
string opts.template_path
string opts.template_path_for_render
string opts.updated
string Returns:
Type Description Promise Example
const hs = new HubspotClient(props); hs.pages.getPages(opts).then(response => console.log(response));
-
List previous versions of a Page
Name Type Description id
int Returns:
Type Description Promise Example
const hs = new HubspotClient(props); hs.pages.getPageVersions(id).then(response => console.log(response))
-
Determine if the auto-save buffer differs from the live page
Name Type Description pageId
int Returns:
Type Description Promise Example
const hs = new HubspotClient(props); hs.pages.hasBufferedChanges(pageId).then(response => console.log(response))
-
Copies the contents of the auto-save buffer into the live Page
Name Type Description id
int Returns:
Type Description Promise Example
const hs = new HubspotClient(props); hs.pages.pushBufferLive(id).then(response => console.log(response))
-
Restores a previously deleted Page
Name Type Description id
int Returns:
Type Description Promise Example
const hs = new HubspotClient(props); hs.pages.restoreDeleted(id).then(response => console.log(response))
-
Restore a previous version of a Page
Name Type Description pageId
int versionId
int Returns:
Type Description Promise Example
const hs = new HubspotClient(props); hs.pages.restorePageVersion(pageId, versionId).then(response => console.log(response))
-
Update the autosave buffer for a page
Name Type Description opts
object Properties:
Name Type Description opts.id
int If set, this will update the page with the corresponding ID.
opts.campaign
string opts.campaign_name
string opts.footer_html
string opts.head_html
string opts.is_draft
boolean opts.meta_description
string opts.meta_keywords
string opts.name
string opts.password
string opts.publish_date
long opts.publish_immediately
boolean opts.slug
string opts.subcategory
string opts.template_path
string opts.template_path_for_render
string opts.widget_containers
string opts.widgets
string Returns:
Type Description Promise Example
const hs = new HubspotClient(props); hs.pages.updateAutosaveBuffer(opts).then(response => console.log(response))
-
Validates the auto-save buffer version of the Page
Name Type Description id
int Returns:
Type Description Promise Example
const hs = new HubspotClient(props); hs.pages.validatePageAutoSaveBuffer(id).then(response => console.log(response))