Platform Registrations API to Hubspot Contact form

forms

#1

Hi guys,

Looking for some help and guidance please with regards to developing an API from our own platform registrations directly into hubspot contacts

Supporting API documentation: (https://developers.hubspot.com/docs/methods/forms/submit_form?utm_source=hs_email&utm_medium=email&_hsenc=p2ANqtz-_jtlziGA1NIQybCnDNqXSUYHtQGdpM_oXbFWHYUMvgZX3rAPn62vQEqGBP5bbu2DDGhSLmX4m14IKNE-JJ300pp1o9mQ&_hsmi=60491770)

The documentation outlines PHP code that requires a single source URL for the form input;

'pageUrl' => 'http://www.example.com/form-page', <===== here

'pageName' => 'Example Title'

);

$hs_context_json = json_encode($hs_context);

//Need to populate these variable with values from the form.

$str_post = "firstname=" . urlencode($firstname)

. "&lastname=" . urlencode($lastname) 

. "&email=" . urlencode($email) 

. "&phone=" . urlencode($phonenumber) 

. "&company=" . urlencode($company) 

. "&hs_context=" . urlencode($hs_context_json); //Leave this one be

Our current user profile information spans a few URL's. Will we be able to use more than one URL form source per contact API?

Would we need to implement a secondary form for additional information?

If I understand correctly, we would target a form GUID in our hubspot account specifically for this function and then use that form within hubspot to extract what we need?


#2

Hi @benadoo,

The pageUrl field is intended to track the URL of the page that the form was submitted on. It's not possible to include multiple URLs here; for multi-page forms, it's common to choose a particular page (either the last or the first) to include in the submission.

I'm not entirely clear on the last part of your question; the form submission endpoint accepts form data from external sources & processes them to create/update contact records. There needs to be a corresponding form in HubSpot in order to submit (hence the form GUID included in the submission URL). What do you mean when you say 'extract what we need'?


#3

Hi Derek

Thanks for your reply and help.

So we could only glean the information from our first url page of the user registration i.e name, password, location for the fields on that page/url?

Sorry, when I say 'extract what we need' I mean that we would use further forms/lists within hubspot to take the initial completed form fields and create smart lists from the data for instance

Have I understood correctly?

Thanks
Ben