HubSpot Grid Integration

The HubSpot Grid integration enables Salesforce users to view, search, inline-edit, create, and delete CRM records from HubSpot (Contacts, Companies, Deals, and Tickets) as well as view live Contact email engagement history directly inside AppColab Grid.

HubSpot Live Grid Preview


What’s Deployed

Component Name Purpose
Named Credential HubSpot Connects to https://api.hubapi.com via HubSpot External Credential
External Credential HubSpot Custom authentication with Bearer <HubSpot_Private_App_Token>
Apex Client HubSpotClient.cls REST client supporting listObjects, describeProperties, searchObjects, createObject, updateObject, deleteObject
Apex Data Provider HubSpotGridDataProvider.cls Implements appcg.GridDataProviderV1 and appcg.GridDataMutationProviderV1 with full CRUD
Permission Set Integration_Admin Grants access to HubSpot → ApiKey external credential principal

One-Time Manual Setup

1. Create or Obtain a Service Key / Private App in HubSpot

Depending on your HubSpot account view, obtain your token using either method:

  • In HubSpot Developer / App Accounts (Recommended):

    1. In the left navigation menu, go to Development → Keys → Service Keys.
    2. Click Create service key (or click an existing key like ColabConnect).
    3. Under Scopes, ensure the required CRM permissions are enabled:
      • crm.objects.contacts.read & crm.objects.contacts.write
      • crm.objects.companies.read & crm.objects.companies.write (optional)
      • sales-email-read (optional, for email engagement history)
    4. Click Copy next to your Service Key (pat-...).
  • In Standard HubSpot CRM Portals:

    1. In your HubSpot portal, click the Settings icon ⚙️ in the top navigation bar.
    2. In the left sidebar, navigate to Integrations → Private Apps.
    3. Click Create private app → name it AppColab Grid.
    4. Under the Scopes tab, select crm.objects.contacts.read and crm.objects.contacts.write.
    5. Click Create app (top-right) → confirm and copy the generated token (pat-...).

HubSpot Service Key & Token Setup


2. Configure Credentials in Salesforce Setup

2.1 Create the External Credential

  1. Go to Setup (gear icon ⚙️ → Setup).
  2. In the Quick Find box, enter Named Credentials and select Named Credentials.
  3. Click the External Credentials tab → click New:
    • Label: HubSpot
    • Name: HubSpot
    • Authentication Protocol: Custom
    • Click Save.
  4. In the Principals section, click New:
    • Parameter Name: ApiKey
    • Sequence: 1
    • Click Save.
  5. In the Custom Headers section, click New:
    • Name: Authorization
    • Value: Bearer YOUR_HUBSPOT_TOKEN (paste token from Step 1)
    • Sequence Number: 1
    • Click Save.

HubSpot External Credential Setup

2.2 Create the Named Credential

  1. Click the Named Credentials tab (next to External Credentials) → click New:
    • Label: HubSpot
    • Name: HubSpot
    • URL: https://api.hubapi.com
    • External Credential: Select HubSpot
    • Generate Authorization Header: Leave Unchecked (handled by custom Authorization header)
    • Allow Formulas in HTTP Header: Checked
  2. Click Save.

HubSpot Named Credential Setup


3. Assign Permission Set Access

  1. In Salesforce Setup, enter Permission Sets in Quick Find.
  2. Select Integration Admin (or Appcolab Grid Admin).
  3. Click External Credential Principal Access → click Edit.
  4. Add HubSpot - ApiKey to Enabled External Credential Principals.
  5. Click Save and verify the permission set is assigned to your Salesforce users.

Creating a HubSpot Grid Definition

  1. In Salesforce, open AppColab Grid app → Grid Definitions tab → click New Grid Definition.
  2. Fill in:
    • Grid Settings Name: HubSpot_Contacts_Grid
    • Grid Label: HubSpot Contacts
    • Is Active?: Checked
    • Data Provider Class: HubSpotGridDataProvider
    • Data Provider Configuration:
      {
        "objectType": "contacts"
      }
      

      Tip: You can also use "companies", "deals", or "tickets" as the objectType.

  3. Click Save & Next → proceed to Preview.
  4. All HubSpot contacts load live with First Name, Last Name, Email, Phone, Company, Lifecycle Stage, and Lead Status!

HubSpot Grid Definition


Supported Grid Features

Feature Details
Full CRUD Inline edit Contact/Deal details, create new contacts, or delete directly from the Grid
Server-Side Pagination Fast, responsive navigation through thousands of HubSpot CRM records
Real-Time Search Leverages HubSpot’s high-speed Search API for instantaneous filtering across names, companies, and emails
Parent Record Association Embed on Salesforce Contact record pages to automatically filter HubSpot records matching the current contact’s email address

Troubleshooting

  • 401 Unauthorized: Invalid token or expired private app: Ensure your HubSpot Private App is active and the token starts with Bearer pat-....
  • 403 Forbidden: Missing scopes: Verify that your Private App in HubSpot has both read and write scopes enabled for the chosen CRM object.