{"id":3295,"date":"2021-02-18T17:12:06","date_gmt":"2021-02-18T17:12:06","guid":{"rendered":"https:\/\/obo.zoj.mybluehost.me\/uncategorized\/hubspot-get-data-via-hubspot-rest-api\/"},"modified":"2025-02-18T18:09:35","modified_gmt":"2025-02-18T18:09:35","slug":"hubspot-get-data-via-hubspot-rest-api","status":"publish","type":"post","link":"https:\/\/ioninteractive.com\/ionacademy\/hubspot-get-data-via-hubspot-rest-api\/","title":{"rendered":"HubSpot: Get data via HubSpot REST API"},"content":{"rendered":"<p>You can leverage Ion\u2019s Get Lead integration with the HubSpot REST API to optimize your Ion experiences. This integration enables you to retrieve data from HubSpot based on a respondent&#8217;s email address. You can leverage Get Lead to pre-populate (or shorten) Ion forms, auto-segment respondents and for progressive profiling.<\/p>\n<p>This document provides step-by-step instructions to set up a REST API integration with HubSpot to get lead data. We\u2019ll use the integration to pre-populate an Ion form in this document, but, as noted, there are a few different ways you can use Get Lead to enhance your ion experiences.<\/p>\n<h3><strong>Before we begin<\/strong><\/h3>\n<p>There are few items you&#8217;ll need to have ready <strong>in Ion<\/strong> prior to setting up the integration, listed below:<\/p>\n<p><em>Check out the &#8220;Before you begin&#8221; <\/em><a href=\"https:\/\/obo.zoj.mybluehost.me\/support-before-you-begin\/\" rel=\"noopener\">support post<\/a> <em>for guidance in creating these items.<\/em><\/p>\n<ul>\n<li>Create data collection fields that will store HubSpot data<\/li>\n<li>Create Ion form(s)<\/li>\n<li>Set-up testing creative<\/li>\n<\/ul>\n<h3><strong>Let\u2019s Get Started!<\/strong><\/h3>\n<h4><strong>1.\u00a0 Add HubSpot account credentials to Ion<\/strong><\/h4>\n<ol>\n<li>Click the Integrations tab in your Ion console\u2019s side nav<\/li>\n<li>Click \u201cSet up account credentials\u201d toward the top of the screen<\/li>\n<li>Under &#8220;HubSpot&#8221;, click \u201cNew HubSpot credential\u201d<\/li>\n<li>Add a friendly label for your account<\/li>\n<li>Save<\/li>\n<li>You will be redirected to HubSpot to authenticate your credentials<\/li>\n<li>After signing into HubSpot, click the Grant access button to allow the Ion platform to access your HubSpot account<\/li>\n<li>After granting access, you will be returned to your Ion console.<\/li>\n<\/ol>\n<h4><strong>2. Create field mapping<\/strong><\/h4>\n<p><em>Taking the steps below will enable you to extend an email address value to HubSpot and map the data points returned to their corresponding ion data collection fields. To get started, add your new field mapping:<\/em><\/p>\n<ol>\n<li>Navigate back to the Integrations screen<\/li>\n<li>Click the green \u201cNew field mapping\u201d button<\/li>\n<li>Label the field mapping and optionally add a description<\/li>\n<li>From the Integration type menu, select \u201cHubSpot\u201d<\/li>\n<li>Save<\/li>\n<\/ol>\n<h4><strong>3. Add Email Address as the Outbound field<\/strong><\/h4>\n<p><em>The email address value will be used as the key to retrieve data from HubSpot.<\/em><\/p>\n<ol>\n<li>Click the green \u201cNew outbound field\u201d button<\/li>\n<li>Select the Data field from the Source drop-down<\/li>\n<li>Select Contact Info &gt; Email Address<\/li>\n<li>Make the field required for the integration to run<\/li>\n<li>Select the corresponding HubSpot Email Address field<\/li>\n<li>Save<\/li>\n<\/ol>\n<h4><strong>4. Create Inbound fields<\/strong><\/h4>\n<p><em>Inbound fields will map the data HubSpot returns into their corresponding Ion data collection fields.<\/em><\/p>\n<ol>\n<li>Click the green \u201cNew inbound field\u201d button<\/li>\n<li>From the Target dropdown menus, select the Ion data collection field you seek to populate with HubSpot data\n<ul>\n<li>To pre-populate Ion forms with HubSpot data, be sure to select the data collection field used on your form<\/li>\n<\/ul>\n<\/li>\n<li>From the Source dropdown, select the HubSpot field you want to pull data from\n<ul>\n<li>OR, select Javascript code if you want to transform the HubSpot data prior to storing it in ion data collection<\/li>\n<li>Use responseBody.hubspot_field_name to access the HubSpot field via Javascript<\/li>\n<\/ul>\n<\/li>\n<li>Save<\/li>\n<li>Repeat these steps for each HubSpot data field you seek to save into ion data collection<\/li>\n<\/ol>\n<h4><strong>5. Create integration<\/strong><\/h4>\n<ol>\n<li>Navigate back to the Integrations screen<\/li>\n<li>Click into the Integrations tab<\/li>\n<li>Click the green \u201cNew integration\u201d button<\/li>\n<li>Enter label<\/li>\n<li>Optionally add a description<\/li>\n<li>Select the Field Mapping you\u2019ve just created<\/li>\n<li>Skip Maximum retries<\/li>\n<li>Select Get Lead as the API method<\/li>\n<li>Select the outbound Email Address field<\/li>\n<li>Optionally add yourself to the debug distribution list for testing\n<ul>\n<li>This will deliver an email to the designated address when the integration runs that displays the request and response from HubSpot<\/li>\n<li>Check Only send error emails if you want to receive the debug email only when there is an error<\/li>\n<\/ul>\n<\/li>\n<\/ol>\n<h4><strong>6. Add integration to ion pages<\/strong><\/h4>\n<p><em>The I<\/em><em>on platform runs the integration based on the rules you create. For HubSpot Get Lead, the rule will typically run the integration at the page-level of the landing page. You can, however, run the integration on any actionable step in your Ion experience. The steps below walk through adding the rule at the page-level to populate an ion form with HubSpot data.<\/em><\/p>\n<ol>\n<li>Navigate into the testing creative with a form that you set up prior to beginning the integration steps<\/li>\n<li>Under the Page tab in creative studio, click on +RULES<\/li>\n<li>Add the following rule:\n<ul>\n<li>Condition: No conditions required<\/li>\n<li>Action: Run integration (select HubSpot Get Lead integration)<\/li>\n<\/ul>\n<\/li>\n<li>Save<\/li>\n<\/ol>\n<h4><strong>7. Test integration<\/strong><\/h4>\n<p>Please note, integrations do not run in Preview Mode, so you&#8217;ll want to open a URL for your testing creative. Either pass an email address into your Ion page on the query string or submit your initial form that collects the email address. If passing an email address into Ion on the query string, be sure that the parameter name you append to the URL matches the &#8220;data name&#8221; of the Ion data collection field selected as the outbound field in your Field Mapping.<\/p>\n<p>Once the integration runs, the form you seek to pre-populate will display the data retrieved from HubSpot. If you\u2019re on the debug email distribution list, you\u2019ll receive an email that displays the request and response from HubSpot.<\/p>\n<h3><strong>Nice work!<\/strong><\/h3>\n<p>Once you\u2019ve completed these steps, your integration is ready for use. You can add the rule to run the integration on all applicable creatives.<\/p>\n<p>As noted, HubSpot Get Lead can be used to accomplish other objectives. Here are some examples that can be accomplished using this integration and ion&#8217;s Rules engine:<\/p>\n<ul>\n<li>Shorten or replace forms<\/li>\n<li>Auto-segment respondents<\/li>\n<li>Build progressive profiles<\/li>\n<li>Serve-up dynamic content based on HubSpot data<\/li>\n<\/ul>\n<p>Feel free to reach out to our Support team for assistance in leveraging this integration.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>You can leverage Ion\u2019s Get Lead integration with the HubSpot REST API to optimize your Ion experiences. This integration enables you to retrieve data from HubSpot based on a respondent&#8217;s email address. You can [&hellip;]<\/p>\n","protected":false},"author":9,"featured_media":6133,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"nf_dc_page":"","footnotes":""},"categories":[2175,2078],"tags":[2173,2316,2216,2208],"class_list":["post-3295","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-ion-integrations-the-advanced-capabilites","category-the-advanced-capabilites","tag-advanced","tag-data","tag-hubspot","tag-ion-integration"],"_links":{"self":[{"href":"https:\/\/ioninteractive.com\/ionacademy\/wp-json\/wp\/v2\/posts\/3295","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ioninteractive.com\/ionacademy\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ioninteractive.com\/ionacademy\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ioninteractive.com\/ionacademy\/wp-json\/wp\/v2\/users\/9"}],"replies":[{"embeddable":true,"href":"https:\/\/ioninteractive.com\/ionacademy\/wp-json\/wp\/v2\/comments?post=3295"}],"version-history":[{"count":2,"href":"https:\/\/ioninteractive.com\/ionacademy\/wp-json\/wp\/v2\/posts\/3295\/revisions"}],"predecessor-version":[{"id":7534,"href":"https:\/\/ioninteractive.com\/ionacademy\/wp-json\/wp\/v2\/posts\/3295\/revisions\/7534"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/ioninteractive.com\/ionacademy\/wp-json\/wp\/v2\/media\/6133"}],"wp:attachment":[{"href":"https:\/\/ioninteractive.com\/ionacademy\/wp-json\/wp\/v2\/media?parent=3295"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ioninteractive.com\/ionacademy\/wp-json\/wp\/v2\/categories?post=3295"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ioninteractive.com\/ionacademy\/wp-json\/wp\/v2\/tags?post=3295"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}