HubSpot Module Basics – Setup

Last Updated: 12/05/2018 Introduced in Version: v4.1

Overview

The HubSpot Module in Decisions allows you to access and update your HubSpot data using steps in a flow that hide the complexities of working with the HubSpot API directly.

Before you can do that, you will need to set up the module and the security parameters that authorize Decisions to access your HubSpot data.

Installing the HubSpot module

If you cannot find any of the steps or capabilities in this document you may need to install the HubSpot module. To install HubSpot module navigate to the System > Administration > Features folder, locate Decisions.HubSpot module in the list of Available Features, and click the Install button.

Setting Up a HubSpot Application

Access to your HubSpot data is governed by a HubSpot Application. When you log into your HubSpot developer account and click the “Apps” menu option, you can view any applications you have set up.

You may create one 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 name to view its details. On that page, you will find the Client ID and Client Secret values. You will need them for the next step.

 

Setting up the HubSpot Provider

In Decisions, navigate to System > Integrations > OAuth > Providers. 

The HubSpot module installs a HubSpot provider, but you will need to initialize it with the Client ID and secret to make the access request.  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. Click OK.

Accessing Your 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 webservice.  In Decisions you must establish an OAuth token which represents a user that will be used to run the REST API and interact with your data in HubSpot.

There are two types of tokens for interacting with HubSpot:

  1. Authorization Token
  2. Access Token

Authorization Token

This token must be setup one time and requires communication between Decisions and HubSpot with a user signing into the HubSpot page and retrieving a token to store in Decisions.  Once you setup an authorization token 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 your flows 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 System > Integrations > OAuth > Tokens.

    1. Click ‘Create Token’
    2. Create token will prompt you with a warning if your BaseURLToPortal is not configured to an externally addressable IP or FQDN. This will NOT prevent you from creating a token, but you will have a manual step because HubSpot will not be able to redirect traffic back to your Decisions installation. If you see that warning you can safely ignore it and continue to follow the instructions below.
    3. Fill in the following form and press “Request Token”          
      1. Token Name: This is a name for you to select later in a flow.  Give the token a meaningful name that you will remember
      2. Provider: Select “HubSpot”

      Once you press “Request Token” you will be redirected in a pop up window to app.hubspot.com. NOTE: Popup blocking applications and add-ons may prevent this from working correctly.  Please disable them and try to request a token again.

    4. Log in using your developer credentials to HubSpot. If you are asked to select an account, select the one you copied the Client ID from.
    5. At this point, you will likely receive a message stating that there is a necessary parameter missing. 

      You will need to alter the web address to which the browser went in order to supply it. At the end of the web address, add &scope=contacts%20content. Your final address should look like:

      https://app.hubspot.com/oauth/authorize?client_id=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx&redirect_uri=https://localhost&scope=contacts%20content

    6. Go to that web address in your browser. You should now be directed to a page that doesn’t exist on your web server. The address will look like http://localhost/?code=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx. Copy this address.
    7. Back in Decisions, in 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 you to and then click the Save Manual Settings button. You can now exit the dialog.

Refresh the page, and the HubSpot Token that you created will appear in the list of tokens. You are now ready to use the HubSpot steps in your Decisions flows.

Additional Resources