Namespace: hs/forms

hs/forms

A collection of methods related to the Forms API

Methods

hs/forms.getForm (formId) asyncstatic

Get Form, including fields, options and validation

Name Type Description
formId string

hs/forms.getFormFields (formId) asyncstatic

Get Form Fields for Specified Form

Name Type Description
formId string
Example
const hs = new HubSpotClient(props);
const formFields = await hs.forms.getFormFields(formId)

hs/forms.getSubmissions (formId) asyncstatic

Get form submissions for specific form

Name Type Description
formId string
Example
const hs = new HubSpotClient(props);
const submissions = await hs.forms.getSubmissions(formId)

hs/forms.submitForm (portalId, formId, formFields)Promise asyncstatic

Submit a form with data See the developer docs for full spec.

Name Type Description
portalId int

Portal ID the form resides on

formId string

ID of form to submit.

formFields object

Key/value pairs of form fields.

Returns:
Type Description
Promise
Example
const hs = new HubspotClient(props);
hs.forms.submitForm(portalId, formId, formFields).then(response => console.log(response));

hs/forms.submitFormV3 (portalId, formId, submitBody)Promise asyncstatic

Submit a form with data See the developer docs for full spec.

Name Type Description
portalId int

Portal ID the form resides on

formId string

ID of form to submit.

submitBody object

{ fields, context, legalConsentOptions } see docs for full spec

Returns:
Type Description
Promise
Example
const hs = new HubspotClient(props);
hs.forms.submitFormV3(portalId, formId, submitBody).then(response => console.log(response));