vishwaj/hubspot.files

0.1.1
hubspot.files Connector

Overview

HubSpot is a leading CRM platform that provides marketing, sales, customer service, and content management tools to help businesses attract, engage, and delight customers at scale.

The ballerinax/hubspot.files package offers APIs to connect and interact with HubSpot Files API endpoints, specifically based on HubSpot Files API v3.

Setup guide

To use the HubSpot Files connector, you must have access to the HubSpot API through a HubSpot developer account and obtain a private app access token. If you do not have a HubSpot account, you can sign up for one here.

Step 1: Create a HubSpot Account

  1. Navigate to the HubSpot website and sign up for an account or log in if you already have one.

  2. Ensure you have a suitable subscription plan. Access to the Files API and its full capabilities (such as managing file storage and retrieving signed URLs) is available on Starter, Professional, and Enterprise plans. Some advanced file management features may be restricted on the free tier.

Step 2: Generate a Private App Access Token

  1. Log in to your HubSpot account.

  2. In the top-right corner, click the Settings icon (gear icon) to open your account settings.

  3. In the left sidebar, navigate to Integrations > Private Apps.

  4. Click Create a private app.

  5. On the Basic Info tab, provide a name and description for your app.

  6. Navigate to the Scopes tab and select the required scopes for file management. Search for and enable the relevant files scopes (e.g., files and files.ui_hidden.read) based on the operations you intend to perform.

  7. Click Create app and confirm by clicking Continue creating in the dialog that appears.

  8. After the app is created, your access token will be displayed on the app details page. Copy this token to use as your API credential.

Tip: You must copy and store this key somewhere safe. It won't be visible again in your account settings for security reasons.

Quickstart

To use the hubspot.files connector in your Ballerina application, update the .bal file as follows:

Step 1: Import the module

Copy
import ballerina/oauth2;
import ballerinax/hubspot.files as hfiles;

Step 2: Instantiate a new connector

  1. Create a Config.toml file and configure the obtained credentials:
Copy
clientId = "<Your_Client_Id>"
clientSecret = "<Your_Client_Secret>"
refreshToken = "<Your_Refresh_Token>"
  1. Create a hfiles:ConnectionConfig and initialize the client:
Copy
configurable string clientId = ?;
configurable string clientSecret = ?;
configurable string refreshToken = ?;

final hfiles:Client hfilesClient = check new({
    auth: {
        clientId,
        clientSecret,
        refreshToken
    }
});

Step 3: Invoke the connector operation

Now, utilize the available connector operations.

Create a new folder

Copy
public function main() returns error? {
    hfiles:FolderInput newFolder = {
        name: "My Assets Folder",
        parentFolderId: "123456789"
    };

    hfiles:Folder response = check hfilesClient->createFolder(newFolder);
}

Step 4: Run the Ballerina application

Copy
bal run

Examples

The hubspot.files connector provides practical examples illustrating usage in various scenarios. Explore these examples, covering the following use cases:

Import

import vishwaj/hubspot.files;Copy

Other versions

0.1.1

0.1.0

Metadata

Released date: 22 days ago

Version: 0.1.1

License: Apache-2.0


Compatibility

Platform: any

Ballerina version: 2201.13.4

GraalVM compatible: Yes


Pull count

Total: 2

Current verison: 1


Weekly downloads


Source repository


Contributors