A collection of methods related to the Forms API
Methods
-
Get Form, including fields, options and validation
Name Type Description formId
string -
Get Form Fields for Specified Form
Name Type Description formId
string Example
const hs = new HubSpotClient(props); const formFields = await hs.forms.getFormFields(formId)
-
Get form submissions for specific form
Name Type Description formId
string Example
const hs = new HubSpotClient(props); const submissions = await hs.forms.getSubmissions(formId)
-
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));
-
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));