diff --git a/README.md b/README.md index 02e777b..1cb7566 100644 --- a/README.md +++ b/README.md @@ -7,26 +7,25 @@ [![GitHub Issues](https://img.shields.io/github/issues/ballerina-platform/ballerina-library/module/hubspot.crm.object.deals.svg?label=Open%20Issues)](https://github.com/ballerina-platform/ballerina-library/labels/module%hubspot.crm.object.deals) ## Overview - [HubSpot](https://developers.hubspot.com/docs/reference/api) is is an AI-powered customer platform. -The `ballerinax/hubspot.crm.obj.deals` package offers APIs to connect and interact with the [HubSpot CRM Deals API](https://developers.hubspot.com/docs/reference/api/crm/objects/deals) endpoints, specifically based on [HubSpot REST API v3](https://developers.hubspot.com/docs/reference/api). - +The `ballerinax/hubspot.crm.obj.deals` package offers APIs to connect and interact with [HubSpot API](https://developers.hubspot.com/docs/reference/api) endpoints, specifically based on [HubSpot Rest API ](https://developers.hubspot.com/docs/reference/api/overview). ## Setup guide To use the HubSpot CRM Deals 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) +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 under your account Within app developer accounts, you can [create developer test accounts](https://developers.hubspot.com/beta-docs/getting-started/account-types#developer-test-accounts) to test apps and integrations without affecting any real HubSpot data. -**_These accounts are only for development and testing purposes. In production you should not use Developer Test Accounts._** +> **Note:** These accounts are only for development and testing purposes. In production you should not use Developer Test Accounts. 1. Go to Test Account section from the left sidebar. @@ -52,16 +51,15 @@ Within app developer accounts, you can [create developer test accounts](https:// 1. Move to the Auth Tab. ![Moving to the Auth tab](https://raw.githubusercontent.com/ballerina-platform/module-ballerinax-hubspot.crm.object.deals/main/docs/resources/create_app_2.png) - 2. In the Scopes section, add the following scopes for your app using the "Add new scope" button. - `crm.objects.deals.read` - `crm.objects.deals.write` + - `crm.objects.deals.read` + - `crm.objects.deals.write` ![Adding the scopes](https://raw.githubusercontent.com/ballerina-platform/module-ballerinax-hubspot.crm.object.deals/main/docs/resources/scope_set.png) -4. Add your Redirect URI in the relevant section. You can also use localhost addresses for local development purposes. Click Create App. +3. Add your Redirect URI in the relevant section. You can also use localhost addresses for local development purposes. Click Create App. ![Adding the redirect URL](https://raw.githubusercontent.com/ballerina-platform/module-ballerinax-hubspot.crm.object.deals/main/docs/resources/create_app_final.png) @@ -83,11 +81,11 @@ Before proceeding with the Quickstart, ensure you have obtained the Access Token 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. - +2. Paste it in the browser and select your developer test account to install the app when prompted. + ![Installing the App](https://raw.githubusercontent.com/ballerina-platform/module-ballerinax-hubspot.crm.object.deals/main/docs/resources/install_app.png) -3. After the installation, the authroization code will be displayed in the browser URL. Copy the code. +3. After the installation, the authorization code will be displayed in the browser URL. 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 ``. @@ -128,7 +126,7 @@ To use the `HubSpot Deals` connector in your Ballerina application, update the ` ### Step 1: Import the module -Import the `hubspot.crm.obj.deals` module. +Import the `ballerinax/hubspot.crm.obj.deals` module. ``` import ballerinax/hubspot.crm.obj.deals; @@ -142,7 +140,7 @@ import ballerinax/hubspot.crm.obj.deals; configurable string clientId = ?; configurable string clientSecret = ?; configurable string refreshToken = ?; - + deals:OAuth2RefreshTokenGrantConfig auth = { clientId, clientSecret, @@ -157,12 +155,13 @@ import ballerinax/hubspot.crm.obj.deals; clientId = "" clientSecret = "" refreshToken = "" - ``` ### Step 3: Use Connector Operations Utilize the connector's operations to create, update and delete deals etc. + #### Create a Deal + ```ballerina deals:SimplePublicObjectInputForCreate payload = { properties: { @@ -172,22 +171,21 @@ Utilize the connector's operations to create, update and delete deals etc. } }; - deals:SimplePublicObject dealCreated = check hubSpotDeals->/.post(payload = payload); + SimplePublicObject out = check hubSpotDeals->/.post(payload = payload); ``` + #### List Deals + ```ballerina - deals:CollectionResponseSimplePublicObjectWithAssociationsForwardPaging dealsList = check hubSpotDeals->/; + deals:CollectionResponseSimplePublicObjectWithAssociationsForwardPaging deals = check hubSpotDeals->/; ``` ## Examples -The `ballerinax/hubspot.crm.obj.deals` connector provides practical examples illustrating usage in various scenarios.Explore these [examples](https://github.com/ballerina-platform/module-ballerinax-hubspot.crm.object.deals/tree/main/examples), covering the following use cases: +The `ballerinax/hubspot.crm.obj.deals` connector provides practical examples illustrating usage in various scenarios. 1. [Create Manage Deals](https://github.com/ballerina-platform/module-ballerinax-hubspot.crm.object.deals/tree/main/examples/manage-deals) - see how the Hubspot API can be used to create deal and manage it through the sales pipeline. -2. [Count Deals](https://github.com/ballerina-platform/module-ballerinax-hubspot.crm.object.deals/tree/main/examples/count-deals) - see how the Hubspot API can be used to count the number of deals in each stages of sales pipeline. - - - +2. [Count Deals in stages](https://github.com/ballerina-platform/module-ballerinax-hubspot.crm.object.deals/tree/main/examples/count-deals) - see how the Hubspot API can be used to count the number of deals in each stages of sales pipeline. ## Build from the source diff --git a/ballerina/Module.md b/ballerina/Module.md index cb96d2c..9dc5f6c 100644 --- a/ballerina/Module.md +++ b/ballerina/Module.md @@ -11,13 +11,13 @@ To use the HubSpot CRM Deals connector, you must have access to the HubSpot API 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) +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 under your account Within app developer accounts, you can [create developer test accounts](https://developers.hubspot.com/beta-docs/getting-started/account-types#developer-test-accounts) to test apps and integrations without affecting any real HubSpot data. -**_These accounts are only for development and testing purposes. In production you should not use Developer Test Accounts._** +> **Note:** These accounts are only for development and testing purposes. In production you should not use Developer Test Accounts. 1. Go to Test Account section from the left sidebar. @@ -43,16 +43,15 @@ Within app developer accounts, you can [create developer test accounts](https:// 1. Move to the Auth Tab. ![Moving to the Auth tab](https://raw.githubusercontent.com/ballerina-platform/module-ballerinax-hubspot.crm.object.deals/main/docs/resources/create_app_2.png) - 2. In the Scopes section, add the following scopes for your app using the "Add new scope" button. - `crm.objects.deals.read` - `crm.objects.deals.write` + - `crm.objects.deals.read` + - `crm.objects.deals.write` ![Adding the scopes](https://raw.githubusercontent.com/ballerina-platform/module-ballerinax-hubspot.crm.object.deals/main/docs/resources/scope_set.png) -4. Add your Redirect URI in the relevant section. You can also use localhost addresses for local development purposes. Click Create App. +3. Add your Redirect URI in the relevant section. You can also use localhost addresses for local development purposes. Click Create App. ![Adding the redirect URL](https://raw.githubusercontent.com/ballerina-platform/module-ballerinax-hubspot.crm.object.deals/main/docs/resources/create_app_final.png) @@ -61,6 +60,7 @@ Within app developer accounts, you can [create developer test accounts](https:// - Navigate to the Auth section of your app. Make sure to save the provided Client ID and Client Secret. ![Getting credentials from auth](https://raw.githubusercontent.com/ballerina-platform/module-ballerinax-hubspot.crm.object.deals/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: @@ -73,11 +73,11 @@ Before proceeding with the Quickstart, ensure you have obtained the Access Token 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. - +2. Paste it in the browser and select your developer test account to install the app when prompted. + ![Installing the App](https://raw.githubusercontent.com/ballerina-platform/module-ballerinax-hubspot.crm.object.deals/main/docs/resources/install_app.png) -3. After the installation, the authroization code will be displayed in the browser URL. Copy the code. +3. After the installation, the authorization code will be displayed in the browser URL. 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 ``. @@ -111,14 +111,14 @@ Before proceeding with the Quickstart, ensure you have obtained the Access Token ``` 5. Store the `refresh_token` securely for use in your application -## Quickstart +## Quickstart To use the `HubSpot Deals` connector in your Ballerina application, update the `.bal` file as follows: ### Step 1: Import the module -Import the `hubspot.crm.obj.deals` module. +Import the `ballerinax/hubspot.crm.obj.deals` module. ``` import ballerinax/hubspot.crm.obj.deals; @@ -132,7 +132,7 @@ import ballerinax/hubspot.crm.obj.deals; configurable string clientId = ?; configurable string clientSecret = ?; configurable string refreshToken = ?; - + deals:OAuth2RefreshTokenGrantConfig auth = { clientId, clientSecret, @@ -151,7 +151,9 @@ import ballerinax/hubspot.crm.obj.deals; ### Step 3: Use Connector Operations Utilize the connector's operations to create, update and delete deals etc. + #### Create a Deal + ```ballerina deals:SimplePublicObjectInputForCreate payload = { properties: { @@ -163,17 +165,16 @@ Utilize the connector's operations to create, update and delete deals etc. SimplePublicObject out = check hubSpotDeals->/.post(payload = payload); ``` + #### List Deals + ```ballerina deals:CollectionResponseSimplePublicObjectWithAssociationsForwardPaging deals = check hubSpotDeals->/; ``` -# Examples +## Examples The `ballerinax/hubspot.crm.obj.deals` connector provides practical examples illustrating usage in various scenarios. 1. [Create Manage Deals](https://github.com/ballerina-platform/module-ballerinax-hubspot.crm.object.deals/tree/main/examples/manage-deals) - see how the Hubspot API can be used to create deal and manage it through the sales pipeline. 2. [Count Deals in stages](https://github.com/ballerina-platform/module-ballerinax-hubspot.crm.object.deals/tree/main/examples/count-deals) - see how the Hubspot API can be used to count the number of deals in each stages of sales pipeline. - - - diff --git a/ballerina/Package.md b/ballerina/Package.md index d8c9e63..9dc5f6c 100644 --- a/ballerina/Package.md +++ b/ballerina/Package.md @@ -1,7 +1,7 @@ ## Overview [HubSpot](https://developers.hubspot.com/docs/reference/api) is is an AI-powered customer platform. -The `ballerinax/hubspot.crm.obj.deals` package offers APIs to connect and interact with [HubSpot API](https://developers.hubspot.com/docs/reference/api) endpoints, specifically based on [HubSpot API v3](https://developers.hubspot.com/docs/reference/api). +The `ballerinax/hubspot.crm.obj.deals` package offers APIs to connect and interact with [HubSpot API](https://developers.hubspot.com/docs/reference/api) endpoints, specifically based on [HubSpot Rest API ](https://developers.hubspot.com/docs/reference/api/overview). ## Setup guide @@ -11,13 +11,13 @@ To use the HubSpot CRM Deals connector, you must have access to the HubSpot API 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) +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 under your account Within app developer accounts, you can [create developer test accounts](https://developers.hubspot.com/beta-docs/getting-started/account-types#developer-test-accounts) to test apps and integrations without affecting any real HubSpot data. -**_These accounts are only for development and testing purposes. In production you should not use Developer Test Accounts._** +> **Note:** These accounts are only for development and testing purposes. In production you should not use Developer Test Accounts. 1. Go to Test Account section from the left sidebar. @@ -43,16 +43,15 @@ Within app developer accounts, you can [create developer test accounts](https:// 1. Move to the Auth Tab. ![Moving to the Auth tab](https://raw.githubusercontent.com/ballerina-platform/module-ballerinax-hubspot.crm.object.deals/main/docs/resources/create_app_2.png) - 2. In the Scopes section, add the following scopes for your app using the "Add new scope" button. - `crm.objects.deals.read` - `crm.objects.deals.write` + - `crm.objects.deals.read` + - `crm.objects.deals.write` ![Adding the scopes](https://raw.githubusercontent.com/ballerina-platform/module-ballerinax-hubspot.crm.object.deals/main/docs/resources/scope_set.png) -4. Add your Redirect URI in the relevant section. You can also use localhost addresses for local development purposes. Click Create App. +3. Add your Redirect URI in the relevant section. You can also use localhost addresses for local development purposes. Click Create App. ![Adding the redirect URL](https://raw.githubusercontent.com/ballerina-platform/module-ballerinax-hubspot.crm.object.deals/main/docs/resources/create_app_final.png) @@ -61,6 +60,7 @@ Within app developer accounts, you can [create developer test accounts](https:// - Navigate to the Auth section of your app. Make sure to save the provided Client ID and Client Secret. ![Getting credentials from auth](https://raw.githubusercontent.com/ballerina-platform/module-ballerinax-hubspot.crm.object.deals/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: @@ -73,11 +73,11 @@ Before proceeding with the Quickstart, ensure you have obtained the Access Token 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. - +2. Paste it in the browser and select your developer test account to install the app when prompted. + ![Installing the App](https://raw.githubusercontent.com/ballerina-platform/module-ballerinax-hubspot.crm.object.deals/main/docs/resources/install_app.png) -3. After the installation, the authroization code will be displayed in the browser URL. Copy the code. +3. After the installation, the authorization code will be displayed in the browser URL. 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 ``. @@ -111,14 +111,14 @@ Before proceeding with the Quickstart, ensure you have obtained the Access Token ``` 5. Store the `refresh_token` securely for use in your application -## Quickstart +## Quickstart To use the `HubSpot Deals` connector in your Ballerina application, update the `.bal` file as follows: ### Step 1: Import the module -Import the `hubspot.crm.obj.deals` module. +Import the `ballerinax/hubspot.crm.obj.deals` module. ``` import ballerinax/hubspot.crm.obj.deals; @@ -132,7 +132,7 @@ import ballerinax/hubspot.crm.obj.deals; configurable string clientId = ?; configurable string clientSecret = ?; configurable string refreshToken = ?; - + deals:OAuth2RefreshTokenGrantConfig auth = { clientId, clientSecret, @@ -151,7 +151,9 @@ import ballerinax/hubspot.crm.obj.deals; ### Step 3: Use Connector Operations Utilize the connector's operations to create, update and delete deals etc. + #### Create a Deal + ```ballerina deals:SimplePublicObjectInputForCreate payload = { properties: { @@ -163,17 +165,16 @@ Utilize the connector's operations to create, update and delete deals etc. SimplePublicObject out = check hubSpotDeals->/.post(payload = payload); ``` + #### List Deals + ```ballerina deals:CollectionResponseSimplePublicObjectWithAssociationsForwardPaging deals = check hubSpotDeals->/; ``` -# Examples +## Examples The `ballerinax/hubspot.crm.obj.deals` connector provides practical examples illustrating usage in various scenarios. 1. [Create Manage Deals](https://github.com/ballerina-platform/module-ballerinax-hubspot.crm.object.deals/tree/main/examples/manage-deals) - see how the Hubspot API can be used to create deal and manage it through the sales pipeline. 2. [Count Deals in stages](https://github.com/ballerina-platform/module-ballerinax-hubspot.crm.object.deals/tree/main/examples/count-deals) - see how the Hubspot API can be used to count the number of deals in each stages of sales pipeline. - - -