Namespace: hs/pages

hs/pages

A collection of methods related to the Page Publishing API

Methods

hs/pages.clonePage (id)Promise asyncstatic

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))

hs/pages.createOrUpdatePage (opts)Promise asyncstatic

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));

hs/pages.deletePage (id)Promise asyncstatic

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))

hs/pages.doPublishAction (pageId, publishAction)Promise asyncstatic

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 or cancel-publish

Returns:
Type Description
Promise
Example
const hs = new HubspotClient(props);
hs.pages.doPublishAction(pageId, publishAction).then(response => console.log(response))

hs/pages.getPageAutosaveBuffer (pageId)Promise asyncstatic

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))

hs/pages.getPageById (id)Promise asyncstatic

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))

hs/pages.getPages (opts)Promise asyncstatic

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));

hs/pages.getPageVersions (id)Promise asyncstatic

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))

hs/pages.hasBufferedChanges (pageId)Promise asyncstatic

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))

hs/pages.pushBufferLive (id)Promise asyncstatic

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))

hs/pages.restoreDeleted (id)Promise asyncstatic

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))

hs/pages.restorePageVersion (pageId, versionId)Promise asyncstatic

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))

hs/pages.updateAutosaveBuffer (opts)Promise asyncstatic

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))

hs/pages.validatePageAutoSaveBuffer (id)Promise asyncstatic

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))