Module hubspot.crm.pipeline
ballerinax/hubspot.crm.pipeline Ballerina library
Deprecation Notice: This connector is deprecated and will no longer be maintained or updated. Use
ballerinax/hubspot.crm.pipelinesinstead.
Overview
The HubSpot connector(https://www.hubspot.com/) OpenAPI specification.
This API provides access to pipelines. Pipelines represent distinct stages in a workflow, like closing a deal or servicing a support ticket. These endpoints provide access to read and modify pipelines in HubSpot. They support deals and tickets object types.
Key Features
- Programmatic access to create and manage resources via REST API
- Manage user accounts and profiles
- Support for webhooks and event-driven workflows
- Secure authentication with API key or OAuth support
Prerequisites
Before using this connector in your Ballerina application, complete the following:
- Create a HubSpot developer account
- Obtain tokens
- Use this guide to obtain the credentials which are needed to create the <CLIENT_ID> and <CLIENT_SECRET>
Quickstart
To use the HubSpot CRM Pipelines connector in your Ballerina application, update the .bal file as follows:
Step 1 - Import connector
First, import the ballerinax/hubspot.crm.pipeline module into the Ballerina project.
import ballerinax/hubspot.crm.pipeline;
Step 2 - Create a new connector instance
You can now make the connection configuration using the access token.
pipeline:ClientConfig clientConfig = { auth : { token: <ACCESS_TOKEN> } }; pipeline:Client baseClient = check new Client(clientConfig);
Step 3 - Invoke connector operation
- Create a pipeline instance
pipeline:PipelineInput event = { stages: [ { label: "In progress", displayOrder: 0, metadata: { "ticketState": "OPEN", "probability": 0.5 } } ], label: "My replaced pipeline", displayOrder: 0 }; pipeline:PipelineInput|error bEvent = baseClient->create("deals", event); if (bEvent is pipeline:PipelineInput) { log:printInfo("Created the pipeline" + bEvent.toString()); } else { log:printError(msg = bEvent.toString()); }
- List pipelines
pipeline:CollectionResponsePipeline|error bEvent = baseClient->getAll("deals"); if (bEvent is pipeline:CollectionResponsePipeline) { log:printInfo("Pipeline list" + bEvent.toString()); } else { log:printError(msg = bEvent.message()); }
- Use
bal runcommand to compile and run the Ballerina program