<?xml version="1.0" encoding="UTF-8"?>
<!-- generator="bbPress/1.0.1" -->
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title>Gravity Support Forums Topic: gform_after_submission hook with 3rd API (Hubspot)</title>
		<link>https://legacy.forums.gravityhelp.com/topic/gform_after_submission-hook-with-3rd-api-hubspot</link>
		<description>Gravity Support Forums Topic: gform_after_submission hook with 3rd API (Hubspot)</description>
		<language>en-US</language>
		<pubDate>Sat, 04 Apr 2026 16:20:22 +0000</pubDate>
		<generator>http://bbpress.org/?v=1.0.1</generator>
		<textInput>
			<title><![CDATA[Search]]></title>
			<description><![CDATA[Search all topics from these forums.]]></description>
			<name>q</name>
			<link>https://legacy.forums.gravityhelp.com/search.php</link>
		</textInput>
		<atom:link href="https://legacy.forums.gravityhelp.com/rss/topic/gform_after_submission-hook-with-3rd-api-hubspot" rel="self" type="application/rss+xml" />

		<item>
			<title>Chris Hajer on "gform_after_submission hook with 3rd API (Hubspot)"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/gform_after_submission-hook-with-3rd-api-hubspot#post-41947</link>
			<pubDate>Tue, 22 Nov 2011 23:01:38 +0000</pubDate>
			<dc:creator>Chris Hajer</dc:creator>
			<guid isPermaLink="false">41947@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;@sclemens we'll continue this discussion on the other topic you opened.  Thank you&#60;/p&#62;
&#60;p&#62;&#60;a href=&#34;http://www.gravityhelp.com/forums/topic/gform_after_submission-hook-with-3rd-api-hubspot&#34; rel=&#34;nofollow&#34;&#62;http://www.gravityhelp.com/forums/topic/gform_after_submission-hook-with-3rd-api-hubspot&#60;/a&#62;
&#60;/p&#62;</description>
		</item>
		<item>
			<title>sclemens on "gform_after_submission hook with 3rd API (Hubspot)"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/gform_after_submission-hook-with-3rd-api-hubspot#post-41925</link>
			<pubDate>Tue, 22 Nov 2011 18:55:12 +0000</pubDate>
			<dc:creator>sclemens</dc:creator>
			<guid isPermaLink="false">41925@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Bump...we also have this question. Gravity folks, what file do we put the HubSpot code into?
&#60;/p&#62;</description>
		</item>
		<item>
			<title>hood@elite-css.com on "gform_after_submission hook with 3rd API (Hubspot)"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/gform_after_submission-hook-with-3rd-api-hubspot#post-37670</link>
			<pubDate>Tue, 11 Oct 2011 23:18:01 +0000</pubDate>
			<dc:creator>hood@elite-css.com</dc:creator>
			<guid isPermaLink="false">37670@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;The form in question in here: &#60;a href=&#34;http://applicoinc.com/contact&#34; rel=&#34;nofollow&#34;&#62;http://applicoinc.com/contact&#60;/a&#62;
&#60;/p&#62;</description>
		</item>
		<item>
			<title>hood@elite-css.com on "gform_after_submission hook with 3rd API (Hubspot)"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/gform_after_submission-hook-with-3rd-api-hubspot#post-37669</link>
			<pubDate>Tue, 11 Oct 2011 23:17:21 +0000</pubDate>
			<dc:creator>hood@elite-css.com</dc:creator>
			<guid isPermaLink="false">37669@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Hi,&#60;/p&#62;
&#60;p&#62;I installed the latest beta build of Gravity forms and I am trying to get the gform_after_submission hook working with hubspot's API.&#60;/p&#62;
&#60;p&#62;This is what I have in my functions.php.  Am I using this hook correctly?&#60;br /&#62;
&#60;pre&#62;&#60;code&#62;add_action(&#38;quot;gform_after_submission&#38;quot;, &#38;quot;after_submission&#38;quot;, 10, 2);

function post_submission_to_api($entry){
$strPost = &#38;quot;&#38;quot;;
//create string with form POST data
$strPost = &#38;quot;FirstName=&#38;quot; . urlencode($_POST[&#38;#39;input_1&#38;#39;])
. &#38;quot;&#38;amp;LastName=&#38;quot; . urlencode($_POST[&#38;#39;input_2&#38;#39;])
. &#38;quot;&#38;amp;Email=&#38;quot; . urlencode($_POST[&#38;#39;input_3&#38;#39;])
. &#38;quot;&#38;amp;Phone=&#38;quot; . urlencode($_POST[&#38;#39;input_6&#38;#39;])
//. &#38;quot;&#38;amp;Fax=&#38;quot; . urlencode($_POST[&#38;#39;fax_number&#38;#39;])
//. &#38;quot;&#38;amp;Website=&#38;quot; . urlencode($_POST[&#38;#39;website&#38;#39;])
. &#38;quot;&#38;amp;Company=&#38;quot; . urlencode($_POST[&#38;#39;input_4&#38;#39;])
. &#38;quot;&#38;amp;JobTitle=&#38;quot; . urlencode($_POST[&#38;#39;input_5&#38;#39;])
//. &#38;quot;&#38;amp;Address=&#38;quot; . urlencode($_POST[&#38;#39;address&#38;#39;])
//. &#38;quot;&#38;amp;City=&#38;quot; . urlencode($_POST[&#38;#39;city&#38;#39;])
//. &#38;quot;&#38;amp;State=&#38;quot; . urlencode($_POST[&#38;#39;state&#38;#39;])
//. &#38;quot;&#38;amp;ZipCode=&#38;quot; . urlencode($_POST[&#38;#39;zip_code&#38;#39;])
//. &#38;quot;&#38;amp;Country=&#38;quot; . urlencode($_POST[&#38;#39;country&#38;#39;])
. &#38;quot;&#38;amp;Message=&#38;quot; . urlencode($_POST[&#38;#39;input_11&#38;#39;])
//. &#38;quot;&#38;amp;NumberEmployees=&#38;quot; . urlencode($_POST[&#38;#39;num_employees&#38;#39;])
//. &#38;quot;&#38;amp;AnnualRevenue=&#38;quot; . urlencode($_POST[&#38;#39;annual_revenue&#38;#39;])
//. &#38;quot;&#38;amp;CloseDate=&#38;quot; . urlencode($_POST[&#38;#39;close_date&#38;#39;])
. &#38;quot;&#38;amp;IPAddress=&#38;quot; . urlencode($_SERVER[&#38;#39;REMOTE_ADDR&#38;#39;])
. &#38;quot;&#38;amp;UserToken=&#38;quot; . urlencode($_COOKIE[&#38;#39;hubspotutk&#38;#39;]);
//set POST URL
$url = &#38;quot;http://applicoinc.app11.hubspot.com/?app=leaddirector&#38;amp;FormName=Final+Contact+Form&#38;quot;;
//intialize cURL and send POST data
$ch = @curl_init();
@curl_setopt($ch, CURLOPT_POST, true);
@curl_setopt($ch, CURLOPT_POSTFIELDS, $strPost);
@curl_setopt($ch, CURLOPT_URL, $url);
@curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
@curl_exec($ch);
@curl_close($ch);
}&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;This is the PHP code sample provided by hubspot&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;&#38;lt;?php
if ($_SERVER[&#38;#39;REQUEST_METHOD&#38;#39;] == &#38;quot;POST&#38;quot;)
{
/*******************************
your existing form processing
********************************/
//START HubSpot Lead Submission
$strPost = &#38;quot;&#38;quot;;
//create string with form POST data
$strPost = &#38;quot;FirstName=&#38;quot; . urlencode($_POST[&#38;#39;first_name&#38;#39;])
. &#38;quot;&#38;amp;LastName=&#38;quot; . urlencode($_POST[&#38;#39;last_name&#38;#39;])
. &#38;quot;&#38;amp;Email=&#38;quot; . urlencode($_POST[&#38;#39;email&#38;#39;])
. &#38;quot;&#38;amp;TwitterHandle=&#38;quot; . urlencode($_POST[&#38;#39;twitter_handle’])
. &#38;quot;&#38;amp;Phone=&#38;quot; . urlencode($_POST[&#38;#39;phone_number&#38;#39;])
. &#38;quot;&#38;amp;Fax=&#38;quot; . urlencode($_POST[&#38;#39;fax_number&#38;#39;])
. &#38;quot;&#38;amp;Website=&#38;quot; . urlencode($_POST[&#38;#39;website&#38;#39;])
. &#38;quot;&#38;amp;Company=&#38;quot; . urlencode($_POST[&#38;#39;company&#38;#39;])
. &#38;quot;&#38;amp;JobTitle=&#38;quot; . urlencode($_POST[&#38;#39;job_title&#38;#39;])
. &#38;quot;&#38;amp;Address=&#38;quot; . urlencode($_POST[&#38;#39;address&#38;#39;])
. &#38;quot;&#38;amp;City=&#38;quot; . urlencode($_POST[&#38;#39;city&#38;#39;])
. &#38;quot;&#38;amp;State=&#38;quot; . urlencode($_POST[&#38;#39;state&#38;#39;])
. &#38;quot;&#38;amp;ZipCode=&#38;quot; . urlencode($_POST[&#38;#39;zip_code&#38;#39;])
. &#38;quot;&#38;amp;Country=&#38;quot; . urlencode($_POST[&#38;#39;country&#38;#39;])
. &#38;quot;&#38;amp;Message=&#38;quot; . urlencode($_POST[&#38;#39;message&#38;#39;])
. &#38;quot;&#38;amp;NumberEmployees=&#38;quot; . urlencode($_POST[&#38;#39;num_employees&#38;#39;])
. &#38;quot;&#38;amp;AnnualRevenue=&#38;quot; . urlencode($_POST[&#38;#39;annual_revenue&#38;#39;])
. &#38;quot;&#38;amp;CloseDate=&#38;quot; . urlencode($_POST[&#38;#39;close_date&#38;#39;])
. &#38;quot;&#38;amp;IPAddress=&#38;quot; . urlencode($_SERVER[&#38;#39;REMOTE_ADDR&#38;#39;])
. &#38;quot;&#38;amp;UserToken=&#38;quot; . urlencode($_COOKIE[&#38;#39;hubspotutk&#38;#39;]);
//set POST URL
$url = &#38;quot;http://yoursite.hubspot.com/?app=leaddirector&#38;amp;FormName=demorequest&#38;quot;;
//intialize cURL and send POST data
$ch = @curl_init();
@curl_setopt($ch, CURLOPT_POST, true);
@curl_setopt($ch, CURLOPT_POSTFIELDS, $strPost);
@curl_setopt($ch, CURLOPT_URL, $url);
@curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
@curl_exec($ch);
@curl_close($ch);
//END HubSpot Lead Submission
}
?&#38;gt;&#60;/code&#62;&#60;/pre&#62;</description>
		</item>

	</channel>
</rss>
