Skip to content

Commit

Permalink
Fix documentation issues
Browse files Browse the repository at this point in the history
  • Loading branch information
ThisaruGuruge committed Jan 22, 2025
1 parent 9df120e commit f945ca3
Show file tree
Hide file tree
Showing 3 changed files with 55 additions and 55 deletions.
42 changes: 20 additions & 22 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand All @@ -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)

Expand All @@ -83,11 +81,11 @@ Before proceeding with the Quickstart, ensure you have obtained the Access Token

Replace the `<YOUR_CLIENT_ID>`, `<YOUR_REDIRECT_URI>` and `<YOUR_SCOPES>` 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 `<YOUR_CLIENT_ID>`, `<YOUR_REDIRECT_URI`> and `<YOUR_CLIENT_SECRET>` with your specific value. Use the code you received in the above step 3 as the `<CODE>`.

Expand Down Expand Up @@ -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;
Expand All @@ -142,7 +140,7 @@ import ballerinax/hubspot.crm.obj.deals;
configurable string clientId = ?;
configurable string clientSecret = ?;
configurable string refreshToken = ?;
deals:OAuth2RefreshTokenGrantConfig auth = {
clientId,
clientSecret,
Expand All @@ -157,12 +155,13 @@ import ballerinax/hubspot.crm.obj.deals;
clientId = "<Client ID>"
clientSecret = "<Client Secret>"
refreshToken = "<Access Token>"
```
### 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: {
Expand All @@ -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
Expand Down
33 changes: 17 additions & 16 deletions ballerina/Module.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand All @@ -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)

Expand All @@ -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:
Expand All @@ -73,11 +73,11 @@ Before proceeding with the Quickstart, ensure you have obtained the Access Token

Replace the `<YOUR_CLIENT_ID>`, `<YOUR_REDIRECT_URI>` and `<YOUR_SCOPES>` 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 `<YOUR_CLIENT_ID>`, `<YOUR_REDIRECT_URI`> and `<YOUR_CLIENT_SECRET>` with your specific value. Use the code you received in the above step 3 as the `<CODE>`.

Expand Down Expand Up @@ -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;
Expand All @@ -132,7 +132,7 @@ import ballerinax/hubspot.crm.obj.deals;
configurable string clientId = ?;
configurable string clientSecret = ?;
configurable string refreshToken = ?;
deals:OAuth2RefreshTokenGrantConfig auth = {
clientId,
clientSecret,
Expand All @@ -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: {
Expand All @@ -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.
35 changes: 18 additions & 17 deletions ballerina/Package.md
Original file line number Diff line number Diff line change
@@ -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

Expand All @@ -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.

Expand All @@ -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)

Expand All @@ -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:
Expand All @@ -73,11 +73,11 @@ Before proceeding with the Quickstart, ensure you have obtained the Access Token

Replace the `<YOUR_CLIENT_ID>`, `<YOUR_REDIRECT_URI>` and `<YOUR_SCOPES>` 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 `<YOUR_CLIENT_ID>`, `<YOUR_REDIRECT_URI`> and `<YOUR_CLIENT_SECRET>` with your specific value. Use the code you received in the above step 3 as the `<CODE>`.

Expand Down Expand Up @@ -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;
Expand All @@ -132,7 +132,7 @@ import ballerinax/hubspot.crm.obj.deals;
configurable string clientId = ?;
configurable string clientSecret = ?;
configurable string refreshToken = ?;
deals:OAuth2RefreshTokenGrantConfig auth = {
clientId,
clientSecret,
Expand All @@ -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: {
Expand All @@ -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.

0 comments on commit f945ca3

Please sign in to comment.