Namespace: hs/hubdb

hs/hubdb

A collection of methods related to the HubDB Tables API

Methods

hs/hubdb.addTableRow (tableId, options)Promise asyncstatic

Add row to a HubDB table

Name Type Description
tableId int
options object
Returns:
Type Description
Promise
Example
const hs = new HubSpotClient(props);
hs.hubdb.addTableRow(tableId, options).then(response => console.log(response))

hs/hubdb.createTable (opts)Promise asyncstatic

Create a new HubDB table

Name Type Description
opts object
Properties:
Name Type Description
opts.name string
opts.useForPages boolean
opts.columns array
opts.publishedAt int
Returns:
Type Description
Promise
Example
const hs = new HubSpotClient(props);
hs.hubdb.createTable(opts).then(response => console.log(response));

hs/hubdb.deleteTableRow (tableId, rowId, options)Promise asyncstatic

Delete row from a HubDB table

Name Type Description
tableId int
rowId int
options object
Returns:
Type Description
Promise
Example
const hs = new HubSpotClient(props);
hs.hubdb.deleteTableRow(tableId, rowId, options).then(response => console.log(response))

hs/hubdb.getTableById (tableId, portalId, options)Promise asyncstatic

Retrieve HubDB table by ID

Name Type Description
tableId int
portalId int
options object
Returns:
Type Description
Promise
Example
const hs = new HubSpotClient(props);
hs.hubdb.getTableById(tableId, portalId, options).then(response => console.log(response))

hs/hubdb.getTableRows (tableId, portalId, options)Promise asyncstatic

Get rows in a HubDB table

Name Type Description
tableId int
portalId int
options object
Returns:
Type Description
Promise
Example
const hs = new HubSpotClient(props);
hs.hubdb.getTableRows(tableId, portalId, options).then(response => console.log(response))

hs/hubdb.getTables ()Promise asyncstatic

Get a collection of HubDB tables

Returns:
Type Description
Promise
Example
const hs = new HubSpotClient(props);
hs.hubdb.getTables(opts).then(response => console.log(response));

hs/hubdb.publishTable (tableId)Promise asyncstatic

Publish a draft table

Name Type Description
tableId int
Returns:
Type Description
Promise
Example
const hs = new HubSpotClient(props);
hs.hubdb.publishTable(tableId).then(response => console.log(response))

hs/hubdb.updateTableRow (tableId, options, rows)Promise asyncstatic

Batch update in a HubDB table

Name Type Description
tableId int
options object
rows array

The rows to update

Returns:
Type Description
Promise
Example
const hs = new HubSpotClient(props);
const options = {
rows: [
{
        id: 1234567,
        createdAt: 1000000000,
        path: 'test',
        name: 'Test',
        values: {
          '2': 'Some data',
          '3': 'None',
        }
      },
      ...more rows
      ]}
hs.hubdb.updateTableRows(tableId, options).then(response => console.log(response))

hs/hubdb.updateTableRow (tableId, rowId, options)Promise asyncstatic

Update row in a HubDB table

Name Type Description
tableId int
rowId int
options object
Returns:
Type Description
Promise
Example
const hs = new HubSpotClient(props);
hs.hubdb.updateTableRow(tableId, rowId, options).then(response => console.log(response))