Setup Guide
This guide walks you through creating a HubSpot Private App and obtaining the access token required to authenticate with the HubSpot Feedback Submissions API.
Prerequisites
- A HubSpot account. If you do not have one, sign up for a free account.
Step 1: Navigate to private apps
- Log in to your HubSpot account.
- Click the Settings gear icon in the top navigation bar.
- In the left sidebar, navigate to Integrations → Private Apps.
Step 2: Create a new private app
- Click Create a private app.
- On the Basic Info tab, enter a name for your app (e.g.,
Ballerina Feedback Connector) and an optional description.
Step 3: Configure required scopes
- Click the Scopes tab.
- In the search box, type
feedbackto filter relevant scopes. - Under CRM, locate and enable the following scope:
crm.objects.feedback_submissions.read: required to read feedback submissions.
- If your integration also needs to create or modify submissions, enable:
crm.objects.feedback_submissions.write
note
HubSpot's Feedback Submissions endpoints are primarily read-only. Write operations may be restricted depending on your HubSpot subscription and the specific survey type.
Step 4: Create the app and copy the access token
- Click Create app in the top-right corner.
- Review the scope summary in the confirmation dialog and click Continue creating.
- On the app detail page, click Show token to reveal your private app access token.
- Copy the token; this is the value you will use as the
privateAppcredential in your connector configuration.
tip
Store your private app token securely. Do not commit it to source control.
Use Ballerina's configurable feature and a Config.toml file to supply it at runtime.
Step 5: Set up OAuth 2.0 (optional: for third-party integrations)
If you are building a third-party integration that acts on behalf of HubSpot customers, use OAuth 2.0 instead of a private app token:
- Go to the HubSpot Developer Portal and create a developer account.
- Under Apps, click Create app.
- On the Auth tab, note the Client ID and Client Secret.
- Add the required scopes under Scopes:
crm.objects.feedback_submissions.read. - Set a Redirect URL for your application (e.g.,
https://your-app.example.com/oauth/callback). - Direct users through the HubSpot OAuth authorization flow:
https://app.hubspot.com/oauth/authorize
?client_id=<YOUR_CLIENT_ID>
&scope=crm.objects.feedback_submissions.read
&redirect_uri=<YOUR_REDIRECT_URI> - Exchange the returned authorization code for an access token and refresh token via:
POST https://api.hubapi.com/oauth/v1/token
Content-Type: application/x-www-form-urlencoded
grant_type=authorization_code
&code=<AUTH_CODE>
&client_id=<YOUR_CLIENT_ID>
&client_secret=<YOUR_CLIENT_SECRET>
&redirect_uri=<YOUR_REDIRECT_URI> - Copy the
refresh_tokenfrom the response for use in your connector configuration.
tip
Use a tool like Postman or curl to perform the token exchange in step 7.