Form API contact not being created in Hubspot



I have a simple php form which i want to use the form api to post the data to Hubspot and create a contact.

Using the form API in my php file. The api is connecting with Hubspot but the variable are not being collected to create the contact.

//Need to populate these variable with values from the form.
$str_post = "first_name=" . urlencode($first_name)
. "&last_name=" . urlencode($last_name)
. "&email=" . urlencode($email)
. "&telephone_number=" . urlencode($telephone_humber)
. "&hs_context=" . urlencode($hs_context_json); //Leave this one be

Is there something wrong with my variables? should i have a $str_post = for each varable? they all seem to match and also match the matching hubspot form. But have no contact data even though the form has been submitted.

Any help would be greatly appreciated.



Hi @Jason_Bell,

I'm not super familiar with PHP, but nothing about your variables is jumping out at me.

Could you share a link to the HubSpot form you're attempting to submit? Submissions which fail to create contacts should still appear in the submission history UI.


Thanks Isaac I got it working