A collection of methods related to the Page Publishing API
Methods
-
Clones a page
Name Type Description idint 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 optsobject Properties:
Name Type Description opts.idint If set, this will update the page with the corresponding ID.
opts.campaignstring opts.campaign_namestring opts.statestring opts.footer_htmlstring opts.head_htmlstring opts.is_draftstring opts.meta_descriptionstring opts.meta_keywordsstring opts.namestring opts.passwordstring opts.publish_datelong opts.publish_immediatelystring opts.slugstring opts.subcategorystring opts.widget_containersstring opts.widgetsstring 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 idint 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 pageIdint publishActionstring One of
push-buffer-live,schedule-publishorcancel-publishReturns:
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 pageIdint 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 idint 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 optsobject Properties:
Name Type Description opts.limitstring opts.offsetstring opts.ab_test_idstring opts.archivedboolean opts.campaignstring opts.createdstring opts.deleted_atstring opts.idint opts.is_draftboolean opts.namestring opts.publish_datelong opts.slugstring opts.subcategorystring opts.template_pathstring opts.template_path_for_renderstring opts.updatedstring 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 idint 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 pageIdint 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 idint 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 idint 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 pageIdint versionIdint 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 optsobject Properties:
Name Type Description opts.idint If set, this will update the page with the corresponding ID.
opts.campaignstring opts.campaign_namestring opts.footer_htmlstring opts.head_htmlstring opts.is_draftboolean opts.meta_descriptionstring opts.meta_keywordsstring opts.namestring opts.passwordstring opts.publish_datelong opts.publish_immediatelyboolean opts.slugstring opts.subcategorystring opts.template_pathstring opts.template_path_for_renderstring opts.widget_containersstring opts.widgetsstring 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 idint Returns:
Type Description Promise Example
const hs = new HubspotClient(props); hs.pages.validatePageAutoSaveBuffer(id).then(response => console.log(response))