APIs & Integrations

MArmstrong34
Membre

Can I use a Hubspot form's data to create a custom form on my website?

I want event registration on my website, but I do not want to use an embedded form. I want to use my own custom form on my website, and then the API to save the data to Hubspot. 

 

Is it possible to make the form on Hubspot, and then (using the form id for it) somehow fetch the form data to use on my front-end in order to build my own custom form? I would then use the API to save each property to a contact. 

 

Thank you in advance!!

0 Votes
2 Réponses
Jaycee_Lewis
Gestionnaire de communauté
Gestionnaire de communauté

Can I use a Hubspot form's data to create a custom form on my website?

Hi, @MArmstrong34 👋 Welcome to our community! 

 

You are on the right track, but there are a few things to note:

  • There's no direct way to fetch a form's structure (like field names and types) to use to construct your form on the frontend via the HubSpot API

  • You can definitely build a custom form on your website that has the same fields as your HubSpot form, and then use the HubSpot Form API to submit data from your custom form

From the documentation — Submit data to a form (Supporting Authentication)

Form submissions from external sources can be made to any registered HubSpot form. You can see a list of forms on your account by navigating to Marketing > Lead Capture >  Forms.” 

And 

“We recommend creating a unique form in HubSpot to parallel your custom website form. This will make it easy to track submissions on that particular custom form in the future.”

 

The quick steps:

  • Create a form in HubSpot to send your data to
  • Build your custom form
  • Make sure to use the same properties as your HubSpot form. Each form field should be an object with 'name' and 'value' properties, like this: {"fields”: [{"name”: “email”, “value”: “example@example.com”}, ...]}
  • Make a submission to this endpoint 
    POST https://api.hsforms.com/submissions/v3/integration/secure/submit/:portalId/:formGuid

 

Have fun building! — Jaycee

 

linkedin

Jaycee Lewis

Developer Community Manager

Community | HubSpot

0 Votes
MArmstrong34
Membre

Can I use a Hubspot form's data to create a custom form on my website?

Hi Jaycee, thanks for the quick and detailed reply. 

 

  • There's no direct way to fetch a form's structure (like field names and types) to use to construct your form on the frontend via the HubSpot API.

What if we use the legacy API? Would that give us that option? I ask because of this page: 

 https://legacydocs.hubspot.com/docs/methods/forms/v2/get_fields

 

Cheers 🙂 

0 Votes