Setup Guide
This guide walks you through creating a HubSpot app and obtaining the OAuth 2.0 credentials required to use the HubSpot CRM Tickets connector.
Prerequisites
- A HubSpot developer account. If you do not have one, sign up here.
Step 1: Create a HubSpot developer test account
- Log in to your HubSpot developer account.
- In the left sidebar, navigate to Test Accounts.
- Click Create developer test account.
- Enter a name for your test account and click Create.
Developer test accounts are for development and testing only. Do not use them in production.
Step 2: Create a HubSpot app
- In your developer account, navigate to the Apps section.
- Click Create App.
- Provide the required details, including the app name and description.
Step 3: Configure OAuth scopes and redirect URI
- In your app settings, navigate to the Auth tab.
- Under Scopes, click Add new scope and add the following scopes:
ticketsoauth
- Under Redirect URLs, add your redirect URI (e.g.,
https://localhost:9090/oauth2/callbackfor local development). - Click Create App (or Save if updating an existing app).
Step 4: Obtain the client ID and client secret
- Navigate to the Auth tab of your app.
- Copy the Client ID and Client Secret; you will need these to generate tokens.
Store the Client ID and Client Secret securely. Do not commit them to source control.
Step 5: Generate the authorization code and refresh token
-
Construct the following authorization URL, replacing the placeholders with your values:
https://app.hubspot.com/oauth/authorize?client_id=<YOUR_CLIENT_ID>&scope=tickets%20oauth&redirect_uri=<YOUR_REDIRECT_URI> -
Open the URL in a browser and select your developer test account when prompted.
-
Authorize the app. After authorization, your browser will redirect to your redirect URI with a
codequery parameter. Copy that code. -
Exchange the authorization code for tokens using the following request:
POST https://api.hubapi.com/oauth/v1/token
Content-Type: application/x-www-form-urlencoded
grant_type=authorization_code
&code=<AUTHORIZATION_CODE>
&redirect_uri=<YOUR_REDIRECT_URI>
&client_id=<YOUR_CLIENT_ID>
&client_secret=<YOUR_CLIENT_SECRET> -
The response includes an
access_tokenand arefresh_token. Save therefresh_token; it is used to obtain new access tokens automatically.
Use a tool like Postman or curl to perform the token exchange in step 4.