- 27 Oct 2020
- 3 Minutes to read
- Print
- DarkLight
HubSpot Module Basics - Setup
- Updated on 27 Oct 2020
- 3 Minutes to read
- Print
- DarkLight
Overview
The HubSpot Module in Decisions allows users to access and update their HubSpot data using steps in a Flow that hides the complexities of working with the HubSpot API directly.
Before users can do that, they will need to set up the Module and the security parameters that authorize Decisions to access their HubSpot data.
Example
Installing the HubSpot Module
If the steps or capabilities in this document cannot be found within the Decisions environment, install the HubSpot Module. To install the HubSpot Module navigate to the System > Administration > Features folder, locate the HubSpot Module in the list of Available Features, and click the Install button.
Setting Up a HubSpot Application
Access to HubSpot data is governed by a HubSpot Application. Log into the HubSpot Developer Account and click the Apps menu option, to view any applications that have been set up.
Create an application for use in Decisions or use an existing one, provided it has the following settings:
- The Scope 'Basic OAuth functionality' has been checked.
- The Contacts and Content areas have been checked.
Once set up, click on the application's Name to view its details. This page will display the Client ID and Client Secret values. These values are needed for the next step.
Setting up the HubSpot Provider
After installing the HubSpot Module and setting up the Application, supply the Provider with the Client ID and Secret Key to make an access request.
To begin, navigate to System > Integrations > OAuth > Providers.
Click on the HubSpot provider and select Edit Provider Settings. In the dialog that appears, paste the Client ID into the Default Consumer Key field, and the Client Secret into the Default Consumer Secret Key field and click SAVE.
Accessing a HubSpot Application
Using any of the pre-built HubSpot steps requires an OAuth Token. OAuth is a standard mechanism for providing security to communicate with a Web Service. In Decisions, users must establish an OAuth Token which represents a user that will be used to run the REST API and interact with the data in HubSpot.
There are two types of Tokens for interacting with HubSpot:
- Authorization Token: This Token is set up and requires communication between Decisions and HubSpot with a user signing into the HubSpot page to retrieve a Token to store in Decisions. Once an Authorization Token has been set up, it should not expire.
- Access Token: The access Token is created using the Authorization Token, but will expire periodically and needs to be refreshed. This can be done automatically in Flows by using Flow steps.
Creating an Authorization Token
Creating an Authorization Token as a first step is important to be able to use any of the HubSpot steps in the HubSpot Module. OAuth Tokens can be created in the System > Integrations > OAuth > Tokens Folder.
The make a new Token, select the CREATE TOKEN button from the bottom toolbar.
CREATE TOKEN will prompt the user with a warning if their BaseURLToPortal is not configured to an externally addressable IP or FQDN. This will NOT prevent the creation of a Token, but will have a manual step due to HubSpot not being able to redirect traffic back to the Decisions installation. If this warning displays, it can safely be ignored. Continue to follow the instructions below.
Fill in the form fields as follows, then press Request Token:
- Token Name: This is a name for selection in Flow; give the Token a meaningful easily remembered name.
- Provider: This designates which Module to interact with; select HubSpot.
Once Request Token is selected, the user will be redirected in a pop-up window to app.hubspot.com.
From the HubSpot window, log in using Hubspot Developer credentials. If asked to select an Account, select the one associated with the Client ID that was copied into the HubSpot Provider.
At this point, the user will likely receive a message stating that there is a necessary parameter missing.
Next, alter the web address that the browser navigated to supply the needed parameter.
At the end of the web address, add "&scope=contacts%20content".
The final address should appear as follows:
"https://app.hubspot.com/oauth/authorize?client_id=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx&redirect_uri=https://localhost&scope=contacts%20content"
Navigate to that web address in the browser. This should direct to a page that doesn't exist on the webserver. The address will look like "http://localhost/?code=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" Copy this address.
Back in Decisions, from the Create and Store OAuth Credentials dialog, click the Set Access Token Manually link.
In the Authorize URL field, paste the response address that HubSpot sent and then click the Save Manual Settings button. Click OK to save the Credentials and close the dialog.
Finally, refresh the page; the newly created HubSpot Token will appear in the list of Tokens.
Proper Token setup will allow the ability to use HubSpot steps in Flows based on those credentials.