# HubSpot

## 1. How to connect to HubSpot?

### OAuth 2.0

You can follow the following steps to build a connection with your HubSpot. If you need any help in setting up your integration, please [contact us](https://docs.acho.io/master#how-to-contact-us).

1\. Go to the **Resources** page and click the **Add Resource** button.

2\. In the "Select a data source" step, select **HubSpot** under **Application**.

3\. Click the <img src="https://3574406564-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MB_fx7PCUqvFEdrucJC%2Fuploads%2FX3gTRm9NZGKaDxSFzxZb%2Fhubspot.png?alt=media&#x26;token=4bc39438-843e-4c4d-8678-8b1fdd9de75a" alt="" data-size="line"> button to log in with your HubSpot account.

4\. After successfully logging in, you'll be redirected back to Acho. Please fill in the required fields and click <img src="https://3574406564-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MB_fx7PCUqvFEdrucJC%2Fuploads%2FfCukFOhE5ww4bXMAEv39%2Fimage.png?alt=media&#x26;token=c8ce6dc7-a0e5-445c-a5ac-917dbf975bb8" alt="" data-size="line">.

5\. Select the tables you wish to sync on the next page and click **Finish Setup**.

6\. You will see a  <img src="https://3574406564-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MB_fx7PCUqvFEdrucJC%2F-MgBh5PshcmRFk38itib%2F-MgBo4LSmdK4OS-NqLZy%2Fsyncing.png?alt=media&#x26;token=452494f9-e4be-48fa-9644-bee7d969c46c" alt="" data-size="line"> icon next to your HubSpot resource. It may take a few minutes to several hours, depending on the data size and the number of your tables. Once your APP's data is ready, you will receive a notification email.&#x20;

### API Key

{% hint style="danger" %}
API key will be deprecated after November 30, 2022. See [HubSpot's post](https://developers.hubspot.com/changelog/upcoming-api-key-sunset?utm_campaign=customer-marketing\&utm_medium=email\&utm_content=220909393\&utm_source=hs_automation) for more details. If you set up your resource with an API key previously and need help migrating to OAuth 2.0, please [contact us](https://docs.acho.io/master#how-to-contact-us).
{% endhint %}

1\. Go to the **Resources** page and click the **Add Resource** button.

2\. In the "Select a data source" step, select **HubSpot** under **Application**.

3\. In the "Configure the data source" step, enter the following information:

* **`Start Date (UTC)`**: Retrieve data from a specific date and time. The date should be defined in  UTC date and time, such as 2017-01-25T00:00:00Z.
* **`API Key`**: Find your API key [here](#2.-how-to-get-the-api-key-from-hubspot).

4\. Select the tables you wish to sync on the next page and click **Finish Setup**.

5\. You will see a  <img src="https://3574406564-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MB_fx7PCUqvFEdrucJC%2F-MgBh5PshcmRFk38itib%2F-MgBo4LSmdK4OS-NqLZy%2Fsyncing.png?alt=media&#x26;token=452494f9-e4be-48fa-9644-bee7d969c46c" alt="" data-size="line"> icon next to your HubSpot resource. It may take a few minutes to several hours depending on the data size and the number of your tables. Once your APP's data is ready, you will receive a notification email. ready, you will receive a notification email.&#x20;

## 2. How to get the API key from HubSpot?

{% hint style="danger" %}
API key will be deprecated after November 30, 2022. See [HubSpot's post](https://developers.hubspot.com/changelog/upcoming-api-key-sunset?utm_campaign=customer-marketing\&utm_medium=email\&utm_content=220909393\&utm_source=hs_automation) for more details. If you set up your resource with an API key previously and need help migrating to OAuth 2.0, please [contact us](https://docs.acho.io/master#how-to-contact-us).
{% endhint %}

To allow Acho to connect to your HubSpot account, you have to get the API key. Here are the instructions about how to acquire it.

{% hint style="info" %}
You must have [Super Admin permissions](https://knowledge.hubspot.com/settings/hubspot-user-permissions-guide?__hstc=45788219.78c31a6a1ef939bde78914f7fa0fd849.1624607212906.1624607212906.1624607212906.1&__hssc=45788219.1.1624607212907&__hsfp=1000307879&_ga=2.230712409.756209440.1624607210-1620574245.1624607210#super-admin) to access your account's API key.
{% endhint %}

1\. Go to your HubSpot account and click the **settings icon** on the top navigation bar.

2\. In the left sidebar menu, navigate to **Integrations** > **API key**.

* If a key has never been generated for your account, click **Generate API** **key**.
* If you've already generated an API key, click **Show** to display your key.

![](https://3574406564-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MB_fx7PCUqvFEdrucJC%2F-Mf4iYLR-sW9TJwq1NzR%2F-Mf4k9pFEONwInDnyLgV%2Fimage.png?alt=media\&token=7a8d22d6-5da8-4e02-a07e-22977870e0ae)

3\. With the key displayed, click **Copy** to copy the key. You can then paste the key to Acho.

## 3. How to set up Data Sync?

Acho supports creating schedulers to retrieve the latest data from your HubSpot account at a certain time interval. To see more details, you can visit [here](https://docs.acho.io/data-sync/untitled).

## 4. Available Data

* [Campaigns](https://developers.hubspot.com/docs/methods/email/get_campaign_data)
* [Companies](https://developers.hubspot.com/docs/api/crm/companies) (Incremental)
* [Contact Lists](http://developers.hubspot.com/docs/methods/lists/get_lists) (Incremental)
* [Contacts](https://developers.hubspot.com/docs/methods/contacts/get_contacts) (Incremental)
* [Contacts List Memberships](https://legacydocs.hubspot.com/docs/methods/contacts/get_contacts)
* [Deal Pipelines](https://developers.hubspot.com/docs/methods/pipelines/get_pipelines_for_object_type)
* [Deals](https://developers.hubspot.com/docs/api/crm/deals) (including Contact associations) (Incremental)
* [Email Events](https://developers.hubspot.com/docs/methods/email/get_events) (Incremental)
* [Engagements](https://legacydocs.hubspot.com/docs/methods/engagements/get-all-engagements) (Incremental)
* [Engagements Calls](https://developers.hubspot.com/docs/api/crm/calls) (Incremental)
* [Engagements Emails](https://developers.hubspot.com/docs/api/crm/email) (Incremental)
* [Engagements Meetings](https://developers.hubspot.com/docs/api/crm/meetings) (Incremental)
* [Engagements Notes](https://developers.hubspot.com/docs/api/crm/notes) (Incremental)
* [Engagements Tasks](https://developers.hubspot.com/docs/api/crm/tasks) (Incremental)
* [Feedback Submissions](https://developers.hubspot.com/docs/api/crm/feedback-submissions) (Incremental)
* [Forms](https://developers.hubspot.com/docs/api/marketing/forms)
* [Form Submissions](https://legacydocs.hubspot.com/docs/methods/forms/get-submissions-for-a-form)
* [Line Items](https://developers.hubspot.com/docs/api/crm/line-items) (Incremental)
* [Marketing Emails](https://legacydocs.hubspot.com/docs/methods/cms_email/get-all-marketing-email-statistics)
* [Owners](https://developers.hubspot.com/docs/methods/owners/get_owners)
* [Products](https://developers.hubspot.com/docs/api/crm/products) (Incremental)
* [Property History](https://legacydocs.hubspot.com/docs/methods/contacts/get_contacts) (Incremental)
* [Quotes](https://developers.hubspot.com/docs/api/crm/quotes) (Incremental)
* [Subscription Changes](https://developers.hubspot.com/docs/methods/email/get_subscriptions_timeline) (Incremental)
* [Tickets](https://developers.hubspot.com/docs/api/crm/tickets) (Incremental)
* [Ticket Pipelines](https://developers.hubspot.com/docs/api/crm/pipelines)
* [Workflows](https://legacydocs.hubspot.com/docs/methods/workflows/v3/get_workflows)

<br>
