The Sisense HubSpot connector is a standalone connector that allows you to import data from HubSpot’s API into the ElastiCube Manager. After you have downloaded and installed the connector, you can connect through a connection string you provide Sisense in the ElastiCube Manager. The connection string is used to authenticate users who connect to the HubSpot APIs. To obtain a connection string, you will need to create a HubSpot app.

Once you have connected to HubSpot, you can import a variety of tables from the HubSpot API.

This page describes how to install the HubSpot connector, how to connect to HubSpot with a connection string, and what tables you can import into the ElastiCube Manager:

Installing the HubSpot Connector

Sisense provides the HubSpot connector as a standalone connector that you can download and add to your list of default Sisense connectors.

To install the HubSpot connector:

  1. Download the HubSpot installation file.
  2. Open the installation file and click Install.
  3. After the installation process is complete, click Close.

The HubSpot connector is displayed in the ElastiCube Manager under Add Data > Web Services.

hubspotconnect

Connecting to the HubSpot REST API

To access HubSpot’s REST API from the ElastiCube Manager, you must provide valid Oauth HubSpot credentials through a connection string. These credentials are provided by HubSpot when you create an application.

After you receive your credentials from HubSpot, you can create the connection string and provide Sisense with it to connect to your data.

Creating an App

Follow the steps below to obtain the OAuth client credentials, the OAuthClientId and OAuthClientSecret:

  1. Log into your HubSpot developer account.
  2. Click Create App.
  3. If you will only use the app to connect to your portal, select One Off.If other users will use the app to connect to their own portals, select For Everyone.
  4. Click the name of your app.
  5. Enter values to be displayed to users when you connect. These values include the app name, author name, and a description of the app.

Authenticating through HubSpot

After setting the following connection properties, you are ready to connect:

  • OAuthClientId: Set this to the client Id in your app settings.
  • OAuthClientSecret: Set this to the client secret in your app settings.
  • CallbackURL: Set this to http://localhost.
  • HubId: Set this to the Hub Id of the HubSpot account you are connecting to.
  • InitiateOAuth: Set this to GETANDREFRESH. You can use InitiateOAuth to avoid repeating the OAuth exchange and manually setting the OAuthAccessToken connection property.

When you connect the driver opens the OAuth endpoint in your default browser. Log in and grant permissions to the application. The driver then completes the OAuth process:

  1. Extracts the access token from the callback URL and authenticates requests.
  2. Refreshes the access token when it expires.
  3. Saves OAuth values in OAuthSettingsLocation to be persisted across connections.

Adding HubSpot Tables to your ElastiCube

Sisense uses connection strings to connect to HubSpot and import data into the ElastiCube Manager.

The connection string to connect to HubSpot has the following structure:

jdbc:HubSpot:Property1=Value1;Property2=Value2;

Mandatory properties are OAuthClientId, OAuthClientSecret, and InitiateOAuth.

  • OAuthSettingsLocation: The location of the settings file where OAuth values are saved when InitiateOAuth is set to GETANDREFRESH.
  • OAuthClientId: Set this to the Client Id in your app settings.
  • OAuthClientSecret: Set this to the Client Secret in your app settings.
  • InitiateOAuth: Set this to GETANDREFRESH. You can use InitiateOAuth to avoid repeating the OAuth exchange and manually setting the OAuthAccessToken connection property.
  • HubId: Set this to the Hub Id of the HubSpot account you are connecting to.
  • CallbackURL: Set this to http://localhost.

Note: To switch between accounts, you need to delete the file OAuthsettings.txt file located at …\Users\xxx\AppData\Roaming\CData\Hubspot Data Provider.

The following is an example of a HubSpot connection string:

jdbc:hubspot:OAuthSettingsLocation=D:\facebook\auth\user.txt;OAuthClientId=4932c41-4f8c-3230-a907-543fds4927;OAuthClientSecret=0as32490-7348-4620-adf4-bdgf54da4;InitiateOAuth=GETANDREFRESH;HubId=24556;CallbackURL=http://localhost;

To add HubSpot data:

  1. In ElastiCube Manager, click Add Data and then, HubSpot. The Connect to HubSpot window is displayed.
    connecthubspot
  2. In Datasource Connection String, enter your connection string.
  3. Click Connect to Server. HubSpot is displayed in the Select Database list.
  4. Click OK. Sisense connects to HubSpot and displays a list of tables available for you to import.
  5. Select the relevant tables and click Add.
    The tables are displayed in the ElastiCube Manager.

Switching between Accounts

When you connect to the HubSpot data source, Sisense saves your OAuth values in the file OAuthsettings.txt file located at …\Users\xxx\AppData\Roaming\CData\HubSpot Data Provider on your Sisense server. To connect to the HubSpot data source with another user on the same machine, you must delete the OAuthsettings.txt file. Sisense will then generate a new file for that user.

Another option to support multiple users is to define the location and file name of an OAuthsettings file for each unique user in your connection string through the OAuthSettingsLocation parameter. When each user connects to the data source, Sisense generates the OAuth file with the file name you specify in the location you define. In the examples below, two users are allowed to access the HubSpot data source and for each user, Sisense generates a file that contains that user’s OAuth values in the location defined in the string.

jdbc:HubSpot:OAuthSettingsLocation=C:\HubSpot\auth\john.txt;OAuthClientId=11276856774486;OAuthClientSecret
=064c70d78567jm2b7e7e4224fad;InitiateOAuth=GETANDREFRESH;Version=2.8;CallbackURL=http://localhost/;

jdbc:HubSpot:OAuthSettingsLocation=C:\HubSpot\auth\sally.txt;OAuthClientId=11276856774486;OAuthClientSecret
=064c70d78567jm2b7e7e4224fad;InitiateOAuth=GETANDREFRESH;Version=2.8;CallbackURL=http://localhost/;

In the example above, to OAuth files are created, one for John and one for Sally in the location C:\HubSpot\auth\.

This is useful if you support many users who each need to access the HubSpot data source.

HubSpot Tables

HubSpot’s RESTful APIs expose the following HubSpot tables that you can import into the ElastiCube Manager through the Sisense HubSpot connector:

NameDescription
BlogAuthorsRetrieve the available blog authors in HubSpot.
BlogPostsRetrieve the available blog posts in HubSpot.
BlogsRetrieve the available blogs in HubSpot.
BlogTopicsRetrieve the available blog topics in HubSpot.
CommentsRetrieve the available comments from your blog in HubSpot.
CompanyPropertiesCompany properties are the standard and custom pieces of field data that appear in HubSpot.
CompanyPropertyGroupsCompany property groups in HubSpot offer a way of organizing individual types of properties for companies. Each company property must belong to a property group.
ContactListsContact lists in HubSpot can be used to group together contacts with similar characteristics.
ContactPropertiesContact properties are the standard and custom pieces of field data that appear in HubSpot.
ContactPropertyGroupsContact property groups in HubSpot offer a way of organizing individual types of properties for contacts. Each contact property must belong to a property group.
DealPropertiesDeal properties are the standard and custom pieces of field data that appear in HubSpot.
DealPropertyGroupsContact property groups in HubSpot offer a way of organizing individual types of properties for contacts. Each contact property must belong to a property group.
DomainsRetrieve the available domains in HubSpot.
EmailCampaignsEmail campaigns in HubSpot allow you to keep track of and update email marketing campaigns. This table allows you to create, update, and delete your email campaigns in HubSpot.
EmailCampaignEventsThe events associated with an email campaign or a recipient.
EmailSubscriptionsThe subscription types a given email is subscribed to. An email must be specified to return results. Subscriptions may be removed by deleting them.
EmailSubscriptionTypesA list of email subscription types for a HubSpot hub.
FilesRetrieves information about the available files in HubSpot.
FoldersRetrieves information about the available folders in HubSpot.
FormsHubSpot Forms.
OwnersRetrieve the owners in HubSpot.
PagesRetrieve the available pages in HubSpot.
SocialMediaChannelsList available social media channels in HubSpot.
SettingsHubSpot settings.
SocialMediaMessagesSocial media messages.
TemplatesRetrieve the available templates in HubSpot.
UrlMappingsRetrieve the available url mappings in HubSpot.
WorkflowsHubSpot workflows.