ballerinax/hubspot.crm.contact Ballerina library

2.3.0

Overview

This is a generated connector from HubSpot 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.

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 Contacts connector in your Ballerina application, update the .bal file as follows:

Step 1 - Import connector

First, import the ballerinax/hubspot.crm.contact module into the Ballerina project.

Copy
import ballerinax/hubspot.crm.contact;

Step 2 - Create a new connector instance

You can now make the connection configuration using the access token.

Copy
contact:ClientConfig clientConfig = {
    auth : {
        token: <ACCESS_TOKEN>
    }
};

contact:Client baseClient = check new Client(clientConfig);

Step 3 - Invoke connector operation

  1. Create a contact instance
Copy
contact:SimplePublicObjectInput contact = {
    properties : {
        "city": "Cambridge",
        "domain": "biglytics.net",
        "industry": "Technology",
        "name": "Biglytics",
        "phone": "(877) 929-0687",
        "state": "Massachusetts"
    }      
};

contact:SimplePublicObject|error bEvent = baseClient->create(contact);

if (bEvent is contact:SimplePublicObject) {
    log:printInfo("Created the contact" + bEvent.toString());
} else {
    log:printError(msg = bEvent.message());
}
  1. List contacts
Copy
contact:SimplePublicObjectWithAssociationsArray|error bEvent = baseClient->getPage();

if (bEvent is contact:SimplePublicObjectWithAssociationsArray) {
    log:printInfo("Contact list" + bEvent.toString());
} else {
    log:printError(msg = bEvent.message());
}
  1. Use bal run command to compile and run the Ballerina program

Import

import ballerinax/hubspot.crm.contact;Copy

Metadata

Released date: over 1 year ago

Version: 2.3.0

License: Apache-2.0


Compatibility

Platform: any

Ballerina version: 2201.4.1

GraalVM compatible: Yes


Pull count

Total: 2844

Current verison: 24


Weekly downloads


Source repository


Keywords

Sales & CRM/Contact Management

Cost/Freemium


Contributors

Other versions

See more...