diff --git a/ballerina/Package.md b/ballerina/Package.md deleted file mode 100644 index d7b14a7..0000000 --- a/ballerina/Package.md +++ /dev/null @@ -1,148 +0,0 @@ -## Overview - -[HubSpot](https://www.hubspot.com/our-story) is an AI-powered customer relationship management (CRM) platform. - -The `ballerinax/hubspot.crm.pipelines` offers APIs to connect and interact with the [Hubspot Pipelines API](https://developers.hubspot.com/docs/guides/api/crm/pipelines) endpoints, specifically based on the [Hubspot Pipelines REST API](https://developers.hubspot.com/docs/reference/api/overview). - -## Setup guide - -To use the `HubSpot CRM Pipelines` connector, you must have access to the HubSpot API through a HubSpot developer account and a HubSpot App under it. Therefore you need to register for a developer account at HubSpot if you don't have one already. - -### Step 1: Create/Login to a HubSpot Developer Account - -If you have an account already, go to the [HubSpot developer portal](https://app.hubspot.com/) - -If you don't have a HubSpot Developer Account you can sign up to a free account [here](https://developers.hubspot.com/get-started) - -### Step 2 (Optional): Create a Developer Test Account - -Within app developer accounts, you can create a [developer test account](https://developers.hubspot.com/beta-docs/getting-started/account-types#developer-test-accounts) under your account to test apps and integrations without affecting any real HubSpot data. - -> **Note:** These accounts are only for development and testing purposes. In production, you should not use Developer Test Accounts. - -1. Go to the Test Account section from the left sidebar. - - ![Hubspot developer portal](https://raw.githubusercontent.com/ballerina-platform/module-ballerinax-hubspot.crm.pipelines/main/docs/resources/test_acc_1.png) - -2. Click Create developer test account. - - ![Hubspot developer testacc](https://raw.githubusercontent.com/ballerina-platform/module-ballerinax-hubspot.crm.pipelines/main/docs/resources/test_acc_2.png) - -3. In the dialogue box, give a name to your test account and click create. - - ![Hubspot developer testacc3](https://raw.githubusercontent.com/ballerina-platform/module-ballerinax-hubspot.crm.pipelines/main/docs/resources/test_acc_3.png) - -### Step 3: Create a HubSpot App under your account - -1. In your developer account, navigate to the "Apps" section. Click on "Create App" - - ![Hubspot app creation 1](https://raw.githubusercontent.com/ballerina-platform/module-ballerinax-hubspot.crm.pipelines/main/docs/resources/create_app_1.png) - -2. Provide the necessary details, including the app name and description. - -### Step 4: Configure the Authentication Flow - -1. Move to the Auth Tab. - - ![Hubspot app creation 2](https://raw.githubusercontent.com/ballerina-platform/module-ballerinax-hubspot.crm.pipelines/main/docs/resources/create_app_2.png) - -2. In the Scopes section, click the "Add new scope" button to add the necessary scopes for your app. - - - `crm.objects.orders.read` - - `crm.schemas.orders.write` - - ![scope](https://raw.githubusercontent.com/ballerina-platform/module-ballerinax-hubspot.crm.pipelines/main/docs/resources/scope.png) - -3. Add your Redirect URI in the relevant section. You can also use localhost addresses for local development purposes. Click Create App. - - ![Hubspot app creation final](https://raw.githubusercontent.com/ballerina-platform/module-ballerinax-hubspot.crm.pipelines/main/docs/resources/create_app_final.png) - -### Step 5: Get your Client ID and Client Secret - -- Navigate to the Auth section of your app. Make sure to save the provided Client ID and Client Secret. - - ![Hubspot get credentials](https://raw.githubusercontent.com/ballerina-platform/module-ballerinax-hubspot.crm.pipelines/main/docs/resources/get_credentials.png) - -### Step 6: Setup Authentication Flow - -Before proceeding with the Quickstart, ensure you have obtained the Access Token using the following steps: - -1. Create an authorization URL using the following format: - - ``` - https://app.hubspot.com/oauth/authorize?client_id=&scope=&redirect_uri= - ``` - - Replace the ``, ``, and `` with your specific value. - -2. Paste it in the browser and select your developer test account to intall the app when prompted. - -3. A code will be displayed in the browser. Copy the code. - -4. Run the following curl command. Replace the ``, ``, and `` with your specific value. Use the code you received in the above step 3 as the ``. - - - Linux/macOS - - ```bash - curl --request POST \ - --url https://api.hubapi.com/oauth/v1/token \ - --header 'content-type: application/x-www-form-urlencoded' \ - --data 'grant_type=authorization_code&code=&redirect_uri=&client_id=&client_secret=' - ``` - - - Windows - - ```bash - curl --request POST ^ - --url https://api.hubapi.com/oauth/v1/token ^ - --header 'content-type: application/x-www-form-urlencoded' ^ - --data 'grant_type=authorization_code&code=&redirect_uri=&client_id=&client_secret=' - ``` - - This command will return the access token necessary for API calls. - - ```json - { - "token_type": "bearer", - "refresh_token": "", - "access_token": "", - "expires_in": 1800 - } - ``` - -5. Store the access token securely for use in your application. - -## Quickstart - - -To use the HubSpot CRM Pipelines connector in your Ballerina application, follow these steps: - -### Step 1: Import the module - -```ballerina -import ballerinax/hubspot.crm.pipelines as hspipelines; -``` - -### Step 2: Instantiate a new connector - -1. Create a `Config.toml` file and configure the obtained credentials: - - ```toml - clientId = "" - clientSecret = "" - refreshToken = "" - ``` - -2. Create a `hspipelines:ConnectionConfig` with the obtained access token and initialize the connector with it. - -### Step 3: Use Connector Operations - -Now, utilize the available connector operations. - -## Examples - -The `HubSpot CRM Pipelines` connector provides practical examples illustrating usage in various scenarios. Explore these [examples](https://github.com/ballerina-platform/module-ballerinax-hubspot.crm.pipelines/tree/main/examples), covering the following use cases: - -1. [Pipeline management](https://github.com/ballerina-platform/module-ballerinax-hubspot.crm.pipelines/tree/main/examples/pipeline-management/main.bal) -2. [Support pipeline](https://github.com/ballerina-platform/module-ballerinax-hubspot.crm.pipelines/tree/main/examples/support-pipeline/main.bal) -3. [Pipeline stage management](https://github.com/ballerina-platform/module-ballerinax-hubspot.crm.pipelines/tree/main/examples/pipeline-stage-management/main.bal) diff --git a/ballerina/Module.md b/ballerina/README.md similarity index 100% rename from ballerina/Module.md rename to ballerina/README.md diff --git a/gradle.properties b/gradle.properties index 5b88d03..6fa8439 100644 --- a/gradle.properties +++ b/gradle.properties @@ -3,5 +3,5 @@ group=io.ballerina.lib version=2.0.0-SNAPSHOT releasePluginVersion=2.8.0 -ballerinaGradlePluginVersion=3.0.0 +ballerinaGradlePluginVersion=2.3.0 ballerinaLangVersion=2201.12.2