hubspot.crm.product
Module hubspot.crm.product
API
Definitions
![](https://bcentral-packageicons.azureedge.net/images/ballerinax_hubspot.crm.product_1.2.0.png)
ballerinax/hubspot.crm.product Ballerina library
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 Products connector in your Ballerina application, update the .bal file as follows:
Step 1 - Import connector
First, import the ballerinax/hubspot.crm.product module into the Ballerina project.
import ballerinax/hubspot.crm.product;
Step 2 - Create a new connector instance
You can now make the connection configuration using the access token.
product:ClientConfig clientConfig = { auth : { token: <ACCESS_TOKEN> } }; product:Client baseClient = check new Client(clientConfig);
Step 3 - Invoke connector operation
- Create a product instance
product:SimplePublicObjectInput product = { properties : { "description": "Onboarding service for data product", "hs_cost_of_goods_sold": "600.00", "hs_recurring_billing_period": "P12M", "hs_sku": "191902", "name": "Implementation Service ", "price": "6000.00" } }; product:SimplePublicObject|error bEvent = baseClient->create(product); if (bEvent is product:SimplePublicObject) { log:printInfo("Created the product" + bEvent.toString()); } else { log:printError(msg = bEvent.message()); }
- List product instances
product:CollectionResponseSimplePublicObjectWithAssociationsForwardPaging|error bEvent = baseClient->getPage(); if (bEvent is product:CollectionResponseSimplePublicObjectWithAssociationsForwardPaging) { log:printInfo("Product list" + bEvent.toString()); } else { log:printError(msg = bEvent.message()); }
- Use
bal run
command to compile and run the Ballerina program
Clients![](/images/permalink.svg)
hubspot.crm.product: Client![](/images/permalink.svg)
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.
Constructor![](/images/permalink.svg)
Gets invoked to initialize the connector
.
The connector initialization requires setting the API credentials.
Create a HubSpot account and obtain OAuth tokens following this guide.
init (ClientConfig clientConfig, string serviceUrl)
- clientConfig ClientConfig - The configurations to be used when initializing the
connector
- serviceUrl string "https://api.hubapi.com/" - URL of the target service
getPage![](/images/permalink.svg)
function getPage(int 'limit, string? after, string[]? properties, string[]? associations, boolean archived) returns CollectionResponseSimplePublicObjectWithAssociationsForwardPaging|error
List
Parameters
- 'limit int (default 10) - The maximum number of results to display per page.
- after string? (default ()) - The paging cursor token of the last successfully read resource will be returned as the
paging.next.after
JSON property of a paged response containing more results.
- properties string[]? (default ()) - A comma separated list of the properties to be returned in the response. If any of the specified properties are not present on the requested object(s), they will be ignored.
- associations string[]? (default ()) - A comma separated list of object types to retrieve associated IDs for. If any of the specified associations do not exist, they will be ignored.
- archived boolean (default false) - Whether to return only results that have been archived.
Return Type
- CollectionResponseSimplePublicObjectWithAssociationsForwardPaging|error - successful operation
create![](/images/permalink.svg)
function create(SimplePublicObjectInput payload) returns SimplePublicObject|error
Create
Parameters
- payload SimplePublicObjectInput -
Return Type
- SimplePublicObject|error - successful operation
batchArchiveArchive![](/images/permalink.svg)
function batchArchiveArchive(BatchInputSimplePublicObjectId payload) returns Response|error
Archive a batch of products by ID
Parameters
- payload BatchInputSimplePublicObjectId -
batchCreateCreate![](/images/permalink.svg)
function batchCreateCreate(BatchInputSimplePublicObjectInput payload) returns BatchResponseSimplePublicObject|BatchResponseSimplePublicObjectWithErrors|error
Create a batch of products
Parameters
- payload BatchInputSimplePublicObjectInput -
Return Type
- BatchResponseSimplePublicObject|BatchResponseSimplePublicObjectWithErrors|error - successful operation
batchReadRead![](/images/permalink.svg)
function batchReadRead(BatchReadInputSimplePublicObjectId payload, boolean archived) returns BatchResponseSimplePublicObject|BatchResponseSimplePublicObjectWithErrors|error
Read a batch of products by internal ID, or unique property values
Parameters
- payload BatchReadInputSimplePublicObjectId -
- archived boolean (default false) - Whether to return only results that have been archived.
Return Type
- BatchResponseSimplePublicObject|BatchResponseSimplePublicObjectWithErrors|error - successful operation
batchUpdateUpdate![](/images/permalink.svg)
function batchUpdateUpdate(BatchInputSimplePublicObjectBatchInput payload) returns BatchResponseSimplePublicObject|BatchResponseSimplePublicObjectWithErrors|error
Update a batch of products
Parameters
- payload BatchInputSimplePublicObjectBatchInput -
Return Type
- BatchResponseSimplePublicObject|BatchResponseSimplePublicObjectWithErrors|error - successful operation
doSearch![](/images/permalink.svg)
function doSearch(PublicObjectSearchRequest payload) returns CollectionResponseWithTotalSimplePublicObjectForwardPaging|error
Filter, Sort, and Search CRM Objects
Parameters
- payload PublicObjectSearchRequest -
Return Type
- CollectionResponseWithTotalSimplePublicObjectForwardPaging|error - successful operation
getById![](/images/permalink.svg)
function getById(string productId, string[]? properties, string[]? associations, boolean archived, string? idProperty) returns SimplePublicObjectWithAssociations|error
Read
Parameters
- productId string - Product ID
- properties string[]? (default ()) - A comma separated list of the properties to be returned in the response. If any of the specified properties are not present on the requested object(s), they will be ignored.
- associations string[]? (default ()) - A comma separated list of object types to retrieve associated IDs for. If any of the specified associations do not exist, they will be ignored.
- archived boolean (default false) - Whether to return only results that have been archived.
- idProperty string? (default ()) - The name of a property whose values are unique for this object type
Return Type
- SimplePublicObjectWithAssociations|error - successful operation
archive![](/images/permalink.svg)
Archive
Parameters
- productId string - Product ID
update![](/images/permalink.svg)
function update(string productId, SimplePublicObjectInput payload, string? idProperty) returns SimplePublicObject|error
Update
Parameters
- productId string - Product ID
- payload SimplePublicObjectInput -
- idProperty string? (default ()) - The name of a property whose values are unique for this object type
Return Type
- SimplePublicObject|error - successful operation
associationsGetAll![](/images/permalink.svg)
function associationsGetAll(string productId, string toObjectType, string? after, int 'limit) returns CollectionResponseAssociatedIdForwardPaging|error
List associations of a product by type
Parameters
- productId string - Product ID
- toObjectType string - Object type to associate with
- after string? (default ()) - The paging cursor token of the last successfully read resource will be returned as the
paging.next.after
JSON property of a paged response containing more results.
- 'limit int (default 500) - The maximum number of results to display per page.
Return Type
- CollectionResponseAssociatedIdForwardPaging|error - successful operation
associationsCreate![](/images/permalink.svg)
function associationsCreate(string productId, string toObjectType, string toObjectId, string associationType) returns SimplePublicObjectWithAssociations|error
Associate a product with another object
Parameters
- productId string - Product ID
- toObjectType string - Object type to associate with
- toObjectId string - Object ID to associate
- associationType string - Type of the association
Return Type
- SimplePublicObjectWithAssociations|error - successful operation
associationsArchive![](/images/permalink.svg)
function associationsArchive(string productId, string toObjectType, string toObjectId, string associationType) returns Response|error
Remove an association between two products
Records![](/images/permalink.svg)
hubspot.crm.product: AssociatedId![](/images/permalink.svg)
Fields
- id string -
- 'type string -
hubspot.crm.product: BatchInputSimplePublicObjectBatchInput![](/images/permalink.svg)
Fields
- inputs SimplePublicObjectBatchInput[] -
hubspot.crm.product: BatchInputSimplePublicObjectId![](/images/permalink.svg)
Fields
- inputs SimplePublicObjectId[] -
hubspot.crm.product: BatchInputSimplePublicObjectInput![](/images/permalink.svg)
Fields
- inputs SimplePublicObjectInput[] -
hubspot.crm.product: BatchReadInputSimplePublicObjectId![](/images/permalink.svg)
Fields
- properties string[] -
- idProperty string? -
- inputs SimplePublicObjectId[] -
hubspot.crm.product: BatchResponseSimplePublicObject![](/images/permalink.svg)
Fields
- status string -
- results SimplePublicObject[] -
- requestedAt string? -
- startedAt string -
- completedAt string -
- links record {}? -
hubspot.crm.product: BatchResponseSimplePublicObjectWithErrors![](/images/permalink.svg)
Fields
- status string -
- results SimplePublicObject[] -
- numErrors int? -
- errors StandardError[]? -
- requestedAt string? -
- startedAt string -
- completedAt string -
- links record {}? -
hubspot.crm.product: ClientConfig![](/images/permalink.svg)
Provides a set of configurations for controlling the behaviours when communicating with a remote HTTP endpoint.
Fields
- auth BearerTokenConfig|OAuth2RefreshTokenGrantConfig - Configurations related to client authentication
- httpVersion string(default "1.1") - The HTTP version understood by the client
- http1Settings ClientHttp1Settings(default {}) - Configurations related to HTTP/1.x protocol
- http2Settings ClientHttp2Settings(default {}) - Configurations related to HTTP/2 protocol
- timeout decimal(default 60) - The maximum time to wait (in seconds) for a response before closing the connection
- forwarded string(default "disable") - The choice of setting
forwarded
/x-forwarded
header
- followRedirects FollowRedirects?(default ()) - Configurations associated with Redirection
- poolConfig PoolConfiguration?(default ()) - Configurations associated with request pooling
- cache CacheConfig(default {}) - HTTP caching related configurations
- compression Compression(default http:COMPRESSION_AUTO) - Specifies the way of handling compression (
accept-encoding
) header
- circuitBreaker CircuitBreakerConfig?(default ()) - Configurations associated with the behaviour of the Circuit Breaker
- retryConfig RetryConfig?(default ()) - Configurations associated with retrying
- cookieConfig CookieConfig?(default ()) - Configurations associated with cookies
- responseLimits ResponseLimitConfigs(default {}) - Configurations associated with inbound response size limits
- secureSocket ClientSecureSocket?(default ()) - SSL/TLS-related options
hubspot.crm.product: CollectionResponseAssociatedId![](/images/permalink.svg)
Fields
- results AssociatedId[] -
- paging Paging? -
hubspot.crm.product: CollectionResponseAssociatedIdForwardPaging![](/images/permalink.svg)
Fields
- results AssociatedId[] -
- paging ForwardPaging? -
hubspot.crm.product: CollectionResponseSimplePublicObjectWithAssociationsForwardPaging![](/images/permalink.svg)
Fields
- results SimplePublicObjectWithAssociations[] -
- paging ForwardPaging? -
hubspot.crm.product: CollectionResponseWithTotalSimplePublicObjectForwardPaging![](/images/permalink.svg)
Fields
- total int -
- results SimplePublicObject[] -
- paging ForwardPaging? -
hubspot.crm.product: Error![](/images/permalink.svg)
Fields
- message string - A human readable message describing the error along with remediation steps where appropriate
- correlationId string - A unique identifier for the request. Include this value with any error reports or support tickets
- category string - The error category
- subCategory string? - A specific category that contains more specific detail about the error
- errors ErrorDetail[]? - further information about the error
- context record {}? - Context about the error condition
- links record {}? - A map of link names to associated URIs containing documentation about the error or recommended remediation steps
hubspot.crm.product: ErrorCategory![](/images/permalink.svg)
Fields
- httpStatus string -
- name string -
hubspot.crm.product: ErrorDetail![](/images/permalink.svg)
Fields
- message string - A human readable message describing the error along with remediation steps where appropriate
- 'in string? - The name of the field or parameter in which the error was found.
- code string? - The status code associated with the error detail
- subCategory string? - A specific category that contains more specific detail about the error
- context record {}? - Context about the error condition
hubspot.crm.product: Filter![](/images/permalink.svg)
Fields
- value string? -
- propertyName string -
- operator string -
hubspot.crm.product: FilterGroup![](/images/permalink.svg)
Fields
- filters Filter[] -
hubspot.crm.product: ForwardPaging![](/images/permalink.svg)
Fields
- next NextPage? -
hubspot.crm.product: NextPage![](/images/permalink.svg)
Fields
- after string -
- link string? -
hubspot.crm.product: Paging![](/images/permalink.svg)
Fields
- next NextPage? -
- prev PreviousPage? -
hubspot.crm.product: PreviousPage![](/images/permalink.svg)
Fields
- before string -
- link string? -
hubspot.crm.product: PublicObjectSearchRequest![](/images/permalink.svg)
Fields
- filterGroups FilterGroup[] -
- sorts string[] -
- query string? -
- properties string[] -
- 'limit int -
- after int -
hubspot.crm.product: SimplePublicObject![](/images/permalink.svg)
Fields
- id string -
- properties record {} -
- createdAt string -
- updatedAt string -
- archived boolean? -
- archivedAt string? -
hubspot.crm.product: SimplePublicObjectBatchInput![](/images/permalink.svg)
Fields
- properties record {} -
- id string -
hubspot.crm.product: SimplePublicObjectId![](/images/permalink.svg)
Fields
- id string -
hubspot.crm.product: SimplePublicObjectInput![](/images/permalink.svg)
Fields
- properties record {} -
hubspot.crm.product: SimplePublicObjectWithAssociations![](/images/permalink.svg)
Fields
- id string -
- properties record {} -
- createdAt string -
- updatedAt string -
- archived boolean? -
- archivedAt string? -
- associations record {}? -
hubspot.crm.product: StandardError![](/images/permalink.svg)
Fields
- status string -
- id string? -
- category ErrorCategory -
- subCategory record {}? -
- message string -
- errors ErrorDetail[] -
- context record {} -
- links record {} -
Import
import ballerinax/hubspot.crm.product;
Metadata
Released date: over 2 years ago
Version: 1.2.0
License: Apache-2.0
Compatibility
Platform: any
Ballerina version: 2201.0.0
GraalVM compatible: Yes
Pull count
Total: 1
Current verison: 0
Weekly downloads
Keywords
Sales & CRM/Customer Relationship Management
Cost/Freemium
Contributors
Dependencies