Example
What you'll build
Build a WSO2 Integrator automation that connects to the HubSpot CRM Companies API, calls the List operation to retrieve all companies, and logs the response. The integration uses a configurable Bearer token for secure authentication.
Operations used:
- List : Retrieves a collection of HubSpot CRM companies using
GET /crm/v3/objects/companies
Architecture
Prerequisites
- A HubSpot account with a Private App access token (Bearer token) that has CRM Companies read permissions
Setting up the HubSpot CRM Companies integration
New to WSO2 Integrator? Follow the Create a New Integration guide to set up your integration first, then return here to add the connector.
Adding the HubSpot CRM Companies connector
Step 1: Open the Add connection palette
Select + Add Connection to open the connector palette. Search for hubspot.crm.obj.companies to locate the pre-built connector.
Configuring the HubSpot CRM Companies connection
Step 2: Fill in the connection parameters
Select the Companies connector card to open the Configure Companies form. Set the connection parameters using configurable variables:
- Config: Authentication configuration that references the
hubspotTokenconfigurable variable: enter{auth: {token: hubspotToken}}in Expression mode - Connection Name : Name used to identify this connection on the canvas
Step 3: Save the connection
Select Save Connection to persist the connection. companiesClient appears under Connections in the sidebar and as a node on the integration canvas.
Step 4: Set actual values for your configurables
In the left panel, select Configurations. Set a value for each configurable listed below:
- hubspotToken (string) : Your HubSpot Private App access token with CRM Companies read permissions
Configuring the HubSpot CRM Companies List operation
Step 5: Add an Automation entry point
- In the Design panel, select + Add Artifact.
- Select Automation from the artifact list.
- In the Create New Automation dialog, keep the default settings and select Create.
The Automation entry point (main) is added under Entry Points in the sidebar. The canvas shows the flow with a Start node and an Error Handler node.
Step 6: Select and configure the List operation
- Select the + (add step) button between Start and Error Handler on the canvas to open the node panel.
- Under Connections, select companiesClient to expand it and view all available operations.
- Select List (
GET /crm/v3/objects/companies) to open the operation configuration panel. - Set the result variable name to
result. No required parameters are needed; optional query parameters are available via Advanced Configurations.
- Result : Variable name that stores the returned collection of companies
Select Save to add the operation to the canvas.
Try it yourself
Try this sample in WSO2 Integration Platform.
More code examples
The Ballerina HubSpot CRM Companies Connector connector provides practical examples illustrating usage in various scenarios. Explore these examples, covering the following use cases:
- Create Count Delete Companies: see how the HubSpot API can be used to create, count and delete companies.
- Update and Merge Companies: see how the HubSpot API can be used to merge and update companies.





