Namespace: hs/layouts

hs/layouts

A collection of methods related to the Layouts API

Methods

hs/layouts.getLayout (layoutId)Promise asyncstatic

Get layout info by ID

Name Type Description
layoutId int
Returns:
Type Description
Promise
Example
const hs = new HubspotClient(props);
hs.layouts.getLayout(layoutId).then(response => console.log(response));

hs/layouts.getLayoutBuffer (layoutId)Promise asyncstatic

Gets the current contents of the auto-save buffer

Name Type Description
layoutId int
Returns:
Type Description
Promise
Example
const hs = new HubspotClient(props);
hs.layout.getLayoutBuffer(layoutId).then(response => console.log(response));

hs/layouts.getLayouts (opts)Promise asyncstatic

Get all layouts for a portal

Name Type Description
opts object
Properties:
Name Type Description
opts.limit int
opts.offset int
opts.category_id int
opts.created int
opts.deleted_at int
opts.id int
opts.label string

Find layouts matching this label.

opts.path string
opts.custom_head string
opts.include_default_custom_css boolean
opts.enable_domain_stylesheet boolean
opts.attached_stylesheets string
Returns:
Type Description
Promise
Example
const hs = new HubspotClient(props);
hs.layouts.getLayouts(opts).then(response => console.log(response));

hs/layouts.getPreviousLayoutVersion (opts)Promise asyncstatic

Get a specific revision of a specific layout. Version id is the id of the version from the list previous versions endpoint

Name Type Description
opts object
Name Type Description
id int

layoutId

versionId int

id of the versionm from the list previous versions endpoint

Returns:
Type Description
Promise
Example
const hs = new HubspotClient(props);
hs.layout.getPreviousLayoutVersion({ id , versionId }).then(response => console.log(response));

hs/layouts.getPreviousLayoutVersions (layoutId)Promise asyncstatic

Get the previous revisions for a specific layout, specified by ID.

Name Type Description
layoutId int
Returns:
Type Description
Promise
Example
const hs = new HubspotClient(props);
hs.layout.getPreviousLayoutVersions(layoutId).then(response => console.log(response));

hs/layouts.hasBufferedChanges (layoutId)Promise asyncstatic

Returns a dictionary: {"has_changes": false/true} depending on if the buffer is different from the live object.

Name Type Description
layoutId int
Returns:
Type Description
Promise
Example
const hs = new HubspotClient(props);
hs.layout.hasBufferedChanges(layoutId).then(response => console.log(response));