Connecting to HubSpot
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:
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:
- Download the HubSpot installation file.
- Open the installation file and click Install.
- After the installation process is complete, click Close.
The HubSpot connector is displayed in the ElastiCube Manager under Add Data > Web Services.
Sisense uses connection strings to connect to HubSpot and import data into the ElastiCube Manager. The default connection string for HubSpot is: jdbc:hubspot:InitiateOAuth=GETANDREFRESH;
After you connect using the default connection string, Sisense redirects you to Hubspot’s homepage where you log in and your account is authenticated. Once the account is authenticated, the relevant tables can be added to your ElastiCube.
If you want to customize your connection string, you can by creating an HubSpot app and passing additional connection string parameters. For more information, see Creating an App at the end of this page.
To add HubSpot data:
- In ElastiCube Manager, click Add Data and then, HubSpot. The Connect to HubSpot window is displayed.
- In Datasource Connection String, enter the connection string: jdbc:hubspot:InitiateOAuth=GETANDREFRESH;
- Click Connect to Server. You are redirected to the HubSpot Login page.
- Log in to your HubSpot account. HubSpot is displayed in the Select Database list in the ElastiCube Manager.
- Click OK. Sisense connects to HubSpot and displays a list of tables available for you to import.
- Select the relevant tables and click Add. The tables are displayed in the ElastiCube Manager.
HubSpot’s RESTful APIs expose the following HubSpot tables that you can import into the ElastiCube Manager through the Sisense HubSpot connector:
|BlogAuthors||Retrieve the available blog authors in HubSpot.|
|BlogPosts||Retrieve the available blog posts in HubSpot.|
|Blogs||Retrieve the available blogs in HubSpot.|
|BlogTopics||Retrieve the available blog topics in HubSpot.|
|Comments||Retrieve the available comments from your blog in HubSpot.|
|Companies||Companies in HubSpot represent different organizations you are interested in keeping track of for potential marketing opportunities. They are treated similarly like contacts and have a number of custom properties that will be dynamically determined and added to the Companies table from your HubSpot Hub.|
|CompanyProperties||Company properties are the standard and custom pieces of field data that appear in HubSpot.|
|CompanyPropertyGroups||Company property groups in HubSpot offer a way of organizing individual types of properties for companies. Each company property must belong to a property group.|
|Contacts||Contacts in HubSpot represent different contacts you are interested in keeping track of for potential marketing opportunities. Contacts are similar to companies: They both have a number of custom properties that will be dynamically determined and added to the table from your HubSpot Hub.|
|ContactLists||Contact lists in HubSpot can be used to group together contacts with similar characteristics.|
|ContactListMemberships||A list of objects that represents the memberships of a contact from their contact lists. This list may be empty if the record is not a member of any lists.|
|ContactProperties||Contact properties are the standard and custom pieces of field data that appear in HubSpot.|
|ContactPropertyGroups||Contact property groups in HubSpot offer a way of organizing individual types of properties for contacts. Each contact property must belong to a property group.|
|DealAssociations||The deal can be associated with either contacts or companies with each request.|
|DealPipelines||Allows you to programmatically access options for the 'deal stage' and 'pipeline' properties within your instance of the HubSpot CRM.>br/> Every portal initially contains a default pipeline with the pipelineId “default”. On portals that have only one pipeline, the pipeline property for any deal will be set to “default” automatically. On portals that have multiple pipelines, if you're setting a dealstage that is not in the default pipeline, you'll also need to set the pipeline property that lines up with the dealstage being used.|
|DealPipelineStages||A list of stages for this specific pipeline.|
|DealProperties||Deal properties are the standard and custom pieces of field data that appear in HubSpot.|
|DealPropertyGroups||Contact property groups in HubSpot offer a way of organizing individual types of properties for contacts. Each contact property must belong to a property group.|
|Deals||Deals in HubSpot represent different organizations you are interested in keeping track of for potential marketing opportunities. They are treated similarly like contacts and have a number of custom properties that will be dynamically determined and added to the Deals table from your HubSpot Hub.|
|Domains||Retrieve the available domains in HubSpot.|
|EmailCampaigns||Email 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.|
|EmailCampaignEvents||The events associated with an email campaign or a recipient.|
|EmailSubscriptions||The subscription types a given email is subscribed to. An email must be specified to return results. Subscriptions may be removed by deleting them.|
|EmailSubscriptionTypes||A list of email subscription types for a HubSpot hub.|
|Engagements||Engagements represent any of a number of different types of engagements you have in HubSpot. These can very from simple Tasks, to Emails, Calls, Meetings, or others. Due to the different types of engagements available, any individual Engagement will have several columns that come back null due to its type.|
|Files||Retrieves information about the available files in HubSpot.|
|Folders||Retrieves information about the available folders in HubSpot.|
|Owners||Retrieve the owners in HubSpot.|
|Pages||Retrieve the available pages in HubSpot.|
|SocialMediaChannels||List available social media channels in HubSpot.|
|SocialMediaMessages||Social media messages.|
|Templates||Retrieve the available templates in HubSpot.|
|UrlMappings||Retrieve the available url mappings in HubSpot.|
Sisense support accumulative builds for all numeric and dates data types. However, the data must be sorted before building the ElastiCube.
|188.8.131.52||April 18, 2017||
UNIX timestamp was set to local time
Note: HubSpot has deprecated the V1 method of retrieving the OAuth Access token. If you have problems authenticating, you will need to log into your HubSpot account with the same user you are using as your OAuth Client Id/Secret.After logging into your HubSpot account, go to your application settings and edit the Scopes. Remove any scopes that you might have selected and save the changes. Then, attempt to retrieve your OAuth token again.For more information, seeMigrating from OAuth1 to OAuth 2.0
|184.108.40.206||March 16, 2017||Dates are handled as expected|
|220.127.116.11||January 16, 2017||General release|
To access HubSpot’s REST API from the ElastiCube Manager with a customized connection string, 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.
Each connection string contains a authentication parameters that the data source uses to verify your identity and what information you can export to Sisense.
The following is an example of a HubSpot connection string and its mandatory parameters:
- HubId: Set your Hubspot account ID to HubId in the connection string.
- OAuthClientId: Set this to the client Id in the connection string.
- OAuthClientSecret: Set this to the client Id in the connection string.
- InitiateOAuth: Set to GETANDREFRESH.
- CallbackURL: Following HubSpot’s migration to OAuth 2.0, the CallbackURL needs to be SSL compliant so it should be https://localhost.
For more information about connection strings and optional parameters, see Connection String Parameters.
When you connect to HubSpot, you are redirected to HubSpot’s site where your Administrator must grant access to your account.
Follow the steps below to obtain the OAuth client credentials, the OAuthClientId and OAuthClientSecret:
- Log into your HubSpot developer account.
- Click Create App.
- In the App name field, enter a name and select Public or Private.
- Click Create.
- In the Apps page, click the name of your app.
- Copy the following values and add them to your connection described in the next procedure.
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.
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.