Module hubspot.crm.deal
ballerinax/hubspot.crm.deal Ballerina library
Deprecation Notice: This connector is deprecated and will no longer be maintained or updated. Use
ballerinax/hubspot.crm.obj.dealsinstead. For association operations, useballerinax/hubspot.crm.associations.
Overview
The HubSpot connector(https://www.hubspot.com/) OpenAPI specification.
This API provides access to collections of CRM objects, which return a map of property names to values. Each object type has its own set of default properties, which can be found by exploring the CRM Object Properties API.
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 Deals connector in your Ballerina application, update the .bal file as follows:
Step 1 - Import connector
First, import the ballerinax/hubspot.crm.deal module into the Ballerina project.
import ballerinax/hubspot.crm.deal;
Step 2 - Create a new connector instance
You can now make the connection configuration using the access token.
deal:ClientConfig clientConfig = { auth : { token: <ACCESS_TOKEN> } }; deal:Client baseClient = check new Client(clientConfig);
Step 3 - Invoke connector operation
- Create a deal instance
deal:SimplePublicObjectInput deal = { properties : { "amount": "1500.00", "closedate": "2019-12-07T16:50:06.678Z", "dealname": "Custom data integrations", "dealstage": "presentationscheduled", "pipeline": "default" } }; deal:SimplePublicObject|error bEvent = baseClient->create(deal); if (bEvent is deal:SimplePublicObject) { log:printInfo("Created the deal" + bEvent.toString()); } else { log:printError(msg = bEvent.message()); }
- List deals
deal:SimplePublicObjectWithAssociationsArray|error bEvent = baseClient->getPage(); if (bEvent is deal:SimplePublicObjectWithAssociationsArray) { log:printInfo("Deal list" + bEvent.toString()); } else { log:printError(msg = bEvent.message()); }
- Use
bal runcommand to compile and run the Ballerina program