I try to post data in order to create contact on hubspot with ColdFusion 7:
<cfset hutk = "#cookie.hubspotutk#">
<cfset pageUrl = "http://www.example.com">
<cfset pageName = "the page name">
<cfset ipAddress = "#url.client_ip#">
<cfset post = {}>
<cfset post['email'] = "#url.email#">
<cfset post['firstname'] = "#url.first_name#">
<cfset post['lastname'] = "#url.last_name#">
<cfset post['company'] = "#url.company#">
<cfset post['website'] = "M1_Website">
<cfset post['phone'] = "#url.phone#">
<cfset post['country'] = "#countrycode#">
<cfset post['owner'] = "#url.owner#">
<cfset hs_context = {}>
<cfset hs_context['hutk'] = #hutk#>
<cfset hs_context['ipAddress'] = #ipAddress#>
<cfset hs_context['pageUrl'] = #pageUrl#>
<cfset hs_context['pageName'] = #pageName#>
<cfset post['hs_context'] = #serializeJSON(hs_context)#>
<cfhttp url="https://forms.hubspot.com/uploads/form/v2/XXXXXX/XXXXXX-XXXXXXX-XXXX-XXXX-XXXXXXXXXX" method="post" result="httpResp" timeout="120">
<cfhttpparam type="header" name="Accept" value="application/json" />
<cfhttpparam type="header" name="Content-Type" value="application/x-www-form-urlencoded" />
<cfhttpparam type="body" value = post>
</cfhttp>
<cfoutput> #httpResp.FileContent# </cfoutput>
But i get this output:
Connexion Failure
Any idea of what I'm doing wrong?