APIs & Integrations

Jason_Bell
Member

Form API contact not being created in Hubspot

SOLVE

Hi,

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.

Regards
Jason

0 Upvotes
1 Accepted solution
Jason_Bell
Solution
Member

Form API contact not being created in Hubspot

SOLVE

Thanks Isaac I got it working

View solution in original post

0 Upvotes
2 Replies 2
Jason_Bell
Solution
Member

Form API contact not being created in Hubspot

SOLVE

Thanks Isaac I got it working

0 Upvotes
IsaacTakushi
HubSpot Employee
HubSpot Employee

Form API contact not being created in Hubspot

SOLVE

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.

Isaac Takushi

Associate Certification Manager
0 Upvotes