A collection of methods related to the Layouts API
Methods
-
Get layout info by ID
Name Type Description layoutIdint Returns:
Type Description Promise Example
const hs = new HubspotClient(props); hs.layouts.getLayout(layoutId).then(response => console.log(response)); -
Gets the current contents of the auto-save buffer
Name Type Description layoutIdint Returns:
Type Description Promise Example
const hs = new HubspotClient(props); hs.layout.getLayoutBuffer(layoutId).then(response => console.log(response)); -
Get all layouts for a portal
Name Type Description optsobject Properties:
Name Type Description opts.limitint opts.offsetint opts.category_idint opts.createdint opts.deleted_atint opts.idint opts.labelstring Find layouts matching this label.
opts.pathstring opts.custom_headstring opts.include_default_custom_cssboolean opts.enable_domain_stylesheetboolean opts.attached_stylesheetsstring Returns:
Type Description Promise Example
const hs = new HubspotClient(props); hs.layouts.getLayouts(opts).then(response => console.log(response)); -
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 optsobject Name Type Description idint layoutId
versionIdint 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)); -
Get the previous revisions for a specific layout, specified by ID.
Name Type Description layoutIdint Returns:
Type Description Promise Example
const hs = new HubspotClient(props); hs.layout.getPreviousLayoutVersions(layoutId).then(response => console.log(response)); -
Returns a dictionary: {"has_changes": false/true} depending on if the buffer is different from the live object.
Name Type Description layoutIdint Returns:
Type Description Promise Example
const hs = new HubspotClient(props); hs.layout.hasBufferedChanges(layoutId).then(response => console.log(response));