Skip to main content
Skip table of contents

HubSpot API Connection

PocketQuery allows you to connect directly to HubSpot’s REST API and query your CRM data with a wide range of objects, such as Contacts, Companies, Deals, and Discounts. You can use PocketQuery to fetch, filter, and explore this data just like any other data source.

This part just walks you through adding the data source. For the complete tutorial on showing HubSpot contacts in Confluence, check out: HubSpot Contacts [REST Custom]

Step 1: Create a private app in HubSpot

  1. Sign into HubSpot as a Super admin.

  2. In your HubSpot account, navigate to Development.

  3. In the left sidebar menu, navigate to Legacy apps.

  4. In the top right, click Create:

    Screenshot of HubSpot Development Settings
  5. In the dialog box, select Private:

    Screenshot of Hubspot Dialog Box
  6. Give the app a name, logo and short description (optional):

    HubSpot Screen for setting up a private app

Step 2: Choose scopes/permissions

  1. Click the Scopes tab.

  2. At the top of the page, click Add new scope:

    Screenshot of HubSpot scope settings
  3. In the right panel, select the checkbox for each scope you want your private app to be able to access. For example, wanting to read contacts, you need to add:

  • crm.objects.contacts.read

    Screenshot of HubSpot settings - adding a new scope

If you want Companies / Deals / etc, add:

  • crm.objects.companies.read, crm.objects.deals.read, ...

  1. After you’ve chosen your scopes, click Create app:

Screenshot of HubSpot Create app button

Step 3: Get your access token

  1. After you finish creating it, HubSpot will redirect you to the app overview (Development → Legacy apps → name of your app).

  2. Go to the Auth tab.

  3. Inside the Access Token box, click Show token.

  4. …and then Copy:

    Screenshot of HubSpot app Auth overview

Step 4: Create a Datasource in PocketQuery

Open PocketQuery Administration → Datasources, and create a new REST datasource:

Field

Value

Name

HubSpot [REST Custom]

Type

REST Custom

Base URL

https://api.hubapi.com/

Request Headers (left field)

Authorization

Request Headers (right field)

Bearer <your-access-token>

(replace “<your-access-token>” with the access token you copied in Step 3)

You can now test your connection by clicking the Test connection link at the bottom. If everything works as expected, click Create Datasource.

That’s it! Now you can use your Datasource in your Queries.

For the complete tutorial on showing Jira issues and pull requests in Confluence, check out: HubSpot Contacts [REST Custom]

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.