hubspot

package
v0.29.0-beta Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 30, 2024 License: MIT Imports: 9 Imported by: 0

README

---
title: "HubSpot"
lang: "en-US"
draft: false
description: "Learn about how to set up a VDP HubSpot component https://github.com/instill-ai/instill-core"
---

The HubSpot component is an application component that allows users to use HubSpot application to do various tasks.
It can carry out the following tasks:
- [Get Contact](#get-contact)
- [Create Contact](#create-contact)
- [Get Deal](#get-deal)
- [Create Deal](#create-deal)
- [Update Deal](#update-deal)
- [Get Company](#get-company)
- [Create Company](#create-company)
- [Get Ticket](#get-ticket)
- [Create Ticket](#create-ticket)
- [Update Ticket](#update-ticket)
- [Get Thread](#get-thread)
- [Insert Message](#insert-message)
- [Retrieve Association](#retrieve-association)
- [Get Owner](#get-owner)
- [Get All](#get-all)

## Release Stage

`Alpha`

## Configuration

The component definition and tasks are defined in the [definition.json](https://github.com/instill-ai/component/blob/main/application/hubspot/v0/config/definition.json) and [tasks.json](https://github.com/instill-ai/component/blob/main/application/hubspot/v0/config/tasks.json) files respectively.

## Setup


In order to communicate with HubSpot, the following connection details need to be
provided. You may specify them directly in a pipeline recipe as key-value pairs
within the component's `setup` block, or you can create a **Connection** from
the [**Integration Settings**](https://www.instill.tech/docs/vdp/integration)
page and reference the whole `setup` as `setup:
${connection.<my-connection-id>}`.

<div class="markdown-col-no-wrap" data-col-1 data-col-2>

| Field | Field ID | Type | Note |
| :--- | :--- | :--- | :--- |
| Token (required) | `token` | string | Fill in your HubSpot private app access token. Go here for [more information](https://developers.hubspot.com/docs/api/private-apps)  |

</div>




## Supported Tasks

### Get Contact

Get contact information using contact ID or Email

<div class="markdown-col-no-wrap" data-col-1 data-col-2>

| Input | ID | Type | Description |
| :--- | :--- | :--- | :--- |
| Task ID (required) | `task` | string | `TASK_GET_CONTACT` |
| Contact ID or Email (required) | `contact-id-or-email` | string | Input contact ID or email. If the input has @, it will search the contact using email |
</div>






<div class="markdown-col-no-wrap" data-col-1 data-col-2>

| Output | ID | Type | Description |
| :--- | :--- | :--- | :--- |
| Owner ID (optional) | `owner-id` | string | The user who is assigned to the object |
| Email Address (optional) | `email` | string | Email address |
| First Name (optional) | `first-name` | string | First name |
| Last Name (optional) | `last-name` | string | Last name |
| Phone Number (optional) | `phone-number` | string | Phone number. If you plan to use the number formatting feature in HubSpot, use country code + phone number. Example: +886xxxxxxxxx |
| Company (optional) | `company` | string | Company |
| Job Title (optional) | `job-title` | string | Job title |
| Lifecycle Stage (optional) | `lifecycle-stage` | string | Lifecycle stages are used to track how contacts or companies move forward in your process. Default format is in small letters, all words are combined. Example: salesqualifiedlead. However, remember to check internal value for custom fields. |
| Lead Status (optional) | `lead-status` | string | The contact's sales, prospecting or outreach status. Default format is in capital letters, with _ as space. Example: IN_PROGRESS. However, remember to check internal value for custom fields. |
| Contact ID | `contact-id` | string | Contact ID |
</div>

### Create Contact

Create new contact

<div class="markdown-col-no-wrap" data-col-1 data-col-2>

| Input | ID | Type | Description |
| :--- | :--- | :--- | :--- |
| Task ID (required) | `task` | string | `TASK_CREATE_CONTACT` |
| Owner ID | `owner-id` | string | The user who is assigned to the object |
| Email Address (required) | `email` | string | Email address |
| First Name | `first-name` | string | First name |
| Last Name | `last-name` | string | Last name |
| Phone Number | `phone-number` | string | Phone number. If you plan to use the number formatting feature in HubSpot, use country code + phone number. Example: +886xxxxxxxxx |
| Company | `company` | string | Company |
| Job Title | `job-title` | string | Job title |
| Lifecycle Stage | `lifecycle-stage` | string | Lifecycle stages are used to track how contacts or companies move forward in your process. Default format is in small letters, all words are combined. Example: salesqualifiedlead. However, remember to check internal value for custom fields. |
| Lead Status | `lead-status` | string | The contact's sales, prospecting or outreach status. Default format is in capital letters, with _ as space. Example: IN_PROGRESS. However, remember to check internal value for custom fields. |
| Create Object -> Deal Association using deal IDs | `create-deals-association` | array[string] | Existing deal IDs to be associated with the object |
| Create Object -> Company Association using company IDs | `create-companies-association` | array[string] | Existing company IDs to be associated with the object |
| Create Object -> Ticket Association using ticket IDs | `create-tickets-association` | array[string] | Existing ticket IDs to be associated with the object |
</div>






<div class="markdown-col-no-wrap" data-col-1 data-col-2>

| Output | ID | Type | Description |
| :--- | :--- | :--- | :--- |
| Contact ID | `contact-id` | string | Contact ID |
</div>

### Get Deal

Get deal information using deal ID

<div class="markdown-col-no-wrap" data-col-1 data-col-2>

| Input | ID | Type | Description |
| :--- | :--- | :--- | :--- |
| Task ID (required) | `task` | string | `TASK_GET_DEAL` |
| Deal ID (required) | `deal-id` | string | Input deal ID |
</div>






<div class="markdown-col-no-wrap" data-col-1 data-col-2>

| Output | ID | Type | Description |
| :--- | :--- | :--- | :--- |
| Owner ID (optional) | `owner-id` | string | The user who is assigned to the object |
| Deal Name | `deal-name` | string | Deal name |
| Pipeline | `pipeline` | string | A pipeline is the place where you document and manage how your prospects move through the steps of your sales process. HubSpot uses interval value rather than the name displayed in the view |
| Deal Stage | `deal-stage` | string | Deal stages allow you to categorize and track the progress of the deals that you are working on. Default format is in small letters, all words are combined. Example: qualifiedtobuy. However, remember to check internal value for custom fields. |
| Amount (optional) | `amount` | number | The total amount of the deal |
| Deal Type (optional) | `deal-type` | string | The type of deal. Default format is in small letters, all words are combined. Example: newbusiness. However, remember to check internal value for custom fields. |
| Close Date (optional) | `close-date` | string | Date the deal was closed. Set automatically by HubSpot. Format is in ISO 8601. Example: 2024-07-01T11:47:40.388Z |
| Create Date (optional) | `create-date` | string | Create date. Format is in ISO 8601. Example: 2024-07-01T11:47:40.388Z |
| Associated Contact IDs (optional) | `associated-contact-ids` | array[string] | Contact IDs associated with the object |
</div>

### Create Deal

Create new deal

<div class="markdown-col-no-wrap" data-col-1 data-col-2>

| Input | ID | Type | Description |
| :--- | :--- | :--- | :--- |
| Task ID (required) | `task` | string | `TASK_CREATE_DEAL` |
| Owner ID | `owner-id` | string | The user who is assigned to the object |
| Deal Name (required) | `deal-name` | string | Deal name |
| Pipeline (required) | `pipeline` | string | A pipeline is the place where you document and manage how your prospects move through the steps of your sales process. HubSpot uses interval value rather than the name displayed in the view |
| Deal Stage (required) | `deal-stage` | string | Deal stages allow you to categorize and track the progress of the deals that you are working on. Default format is in small letters, all words are combined. Example: qualifiedtobuy. However, remember to check internal value for custom fields. |
| Amount | `amount` | number | The total amount of the deal |
| Deal Type | `deal-type` | string | The type of deal. Default format is in small letters, all words are combined. Example: newbusiness. However, remember to check internal value for custom fields. |
| Close Date | `close-date` | string | Date the deal was closed. Set automatically by HubSpot. Format is in ISO 8601. Example: 2024-07-01T11:47:40.388Z |
| Create Object -> Contact Association using contact IDs | `create-contacts-association` | array[string] | Existing contact IDs to be associated with the object |
</div>






<div class="markdown-col-no-wrap" data-col-1 data-col-2>

| Output | ID | Type | Description |
| :--- | :--- | :--- | :--- |
| Deal ID | `deal-id` | string | Deal ID |
</div>

### Update Deal

Update existing deal

<div class="markdown-col-no-wrap" data-col-1 data-col-2>

| Input | ID | Type | Description |
| :--- | :--- | :--- | :--- |
| Task ID (required) | `task` | string | `TASK_UPDATE_DEAL` |
| Deal ID (required) | `deal-id` | string | Input deal ID |
| Owner ID | `owner-id` | string | The user who is assigned to the object |
| Deal Name | `deal-name` | string | Deal name |
| Pipeline | `pipeline` | string | A pipeline is the place where you document and manage how your prospects move through the steps of your sales process. HubSpot uses interval value rather than the name displayed in the view |
| Deal Stage | `deal-stage` | string | Deal stages allow you to categorize and track the progress of the deals that you are working on. Default format is in small letters, all words are combined. Example: qualifiedtobuy. However, remember to check internal value for custom fields. |
| Amount | `amount` | number | The total amount of the deal |
| Deal Type | `deal-type` | string | The type of deal. Default format is in small letters, all words are combined. Example: newbusiness. However, remember to check internal value for custom fields. |
| Close Date | `close-date` | string | Date the deal was closed. Set automatically by HubSpot. Format is in ISO 8601. Example: 2024-07-01T11:47:40.388Z |
| Create Object -> Contact Association using contact IDs | `create-contacts-association` | array[string] | Existing contact IDs to be associated with the object |
</div>






<div class="markdown-col-no-wrap" data-col-1 data-col-2>

| Output | ID | Type | Description |
| :--- | :--- | :--- | :--- |
| Updated By User ID | `updated-by-user-id` | string | User ID that updated the deal |
| Updated At | `updated-at` | string | The time when the deal was updated |
</div>

### Get Company

Get company information using company ID

<div class="markdown-col-no-wrap" data-col-1 data-col-2>

| Input | ID | Type | Description |
| :--- | :--- | :--- | :--- |
| Task ID (required) | `task` | string | `TASK_GET_COMPANY` |
| Company ID (required) | `company-id` | string | Input company ID |
</div>






<div class="markdown-col-no-wrap" data-col-1 data-col-2>

| Output | ID | Type | Description |
| :--- | :--- | :--- | :--- |
| Owner ID (optional) | `owner-id` | string | The user who is assigned to the object |
| Company Name (optional) | `company-name` | string | Company name |
| Company Domain (optional) | `company-domain` | string | The domain name of the company |
| Description (optional) | `description` | string | Description of the company |
| Phone Number (optional) | `phone-number` | string | Phone number of the company. If you plan to use the number formatting feature in HubSpot, use country code + phone number. Example: +886xxxxxxxxx |
| Industry (optional) | `industry` | string | The industry the company belongs to. Default format is in capital letters, with _ as space. Example: BROADCAST_MEDIA |
| Company Type (optional) | `company-type` | string | Type of company. Default format is capital letter. Example: RESELLER |
| City (optional) | `city` | string | City |
| State (optional) | `state` | string | State |
| Country (optional) | `country` | string | Country |
| Postal Code (optional) | `postal-code,` | string | Postal code |
| Time Zone (optional) | `time-zone` | string | Time zone |
| Annual Revenue (optional) | `annual-revenue` | number | Annual revenue |
| Total Revenue (optional) | `total-revenue` | number | Total revenue. Calculated automatically by HubSpot |
| Linkedin Page (optional) | `linkedin-page` | string | Linkedin page of the company |
| Associated Contact IDs (optional) | `associated-contact-ids` | array[string] | Contact IDs associated with the object |
</div>

### Create Company

Create new company

<div class="markdown-col-no-wrap" data-col-1 data-col-2>

| Input | ID | Type | Description |
| :--- | :--- | :--- | :--- |
| Task ID (required) | `task` | string | `TASK_CREATE_COMPANY` |
| Owner ID | `owner-id` | string | The user who is assigned to the object |
| Company Name | `company-name` | string | Company name |
| Company Domain (required) | `company-domain` | string | The domain name of the company |
| Description | `description` | string | Description of the company |
| Phone Number | `phone-number` | string | Phone number of the company. If you plan to use the number formatting feature in HubSpot, use country code + phone number. Example: +886xxxxxxxxx |
| Industry | `industry` | string | The industry the company belongs to. Default format is in capital letters, with _ as space. Example: BROADCAST_MEDIA |
| Company Type | `company-type` | string | Type of company. Default format is capital letter. Example: RESELLER |
| City | `city` | string | City |
| State | `state` | string | State |
| Country | `country` | string | Country |
| Postal Code | `postal-code,` | string | Postal code |
| Time Zone | `time-zone` | string | Time zone |
| Annual Revenue | `annual-revenue` | number | Annual revenue |
| Linkedin Page | `linkedin-page` | string | Linkedin page of the company |
| Create Object -> Contact Association using contact IDs | `create-contacts-association` | array[string] | Existing contact IDs to be associated with the object |
</div>






<div class="markdown-col-no-wrap" data-col-1 data-col-2>

| Output | ID | Type | Description |
| :--- | :--- | :--- | :--- |
| Company ID | `company-id` | string | Company ID |
</div>

### Get Ticket

Get ticket information using ticket ID

<div class="markdown-col-no-wrap" data-col-1 data-col-2>

| Input | ID | Type | Description |
| :--- | :--- | :--- | :--- |
| Task ID (required) | `task` | string | `TASK_GET_TICKET` |
| Ticket ID (required) | `ticket-id` | string | Input ticket ID |
</div>






<div class="markdown-col-no-wrap" data-col-1 data-col-2>

| Output | ID | Type | Description |
| :--- | :--- | :--- | :--- |
| Owner ID (optional) | `owner-id` | string | The user who is assigned to the object |
| Ticket Name | `ticket-name` | string | Ticket name |
| Ticket Status | `ticket-status` | string | The pipeline stage that contains this ticket. Default format is number. Example: 1. However, remember to check internal value for custom fields. Note: In Instill AI, ticket-status is displayed as string because of the possible custom internal value. |
| Pipeline | `pipeline` | string | A pipeline organizes and tracks the progression of tickets through various stages of resolution within your support process. HubSpot uses interval value rather than the name displayed in the view |
| Categories (optional) | `categories` | array[string] | The main reason customer reached out for help. Default format is in capital letters. Example: BILLING_ISSUE. However, remember to check internal value for custom fields. |
| Priority (optional) | `priority` | string | The level of attention needed on the ticket. Default format is in capital letters. Example: MEDIUM. However, remember to check internal value for custom fields. |
| Source (optional) | `source` | string | Channel where ticket was originally submitted. Default format is in capital letters. Example: EMAIL |
| Record Source (optional) | `record-source` | string | How this record was created. |
| Create Date (optional) | `create-date` | string | Create date. Format is in ISO 8601. Example: 2024-07-01T11:47:40.388Z |
| Last Modified Date (optional) | `last-modified-date` | string | Last modified date. Format is in ISO 8601. Example: 2024-07-01T11:47:40.388Z |
| Associated Contact IDs (optional) | `associated-contact-ids` | array[string] | Contact IDs associated with the object |
</div>

### Create Ticket

Create new ticket

<div class="markdown-col-no-wrap" data-col-1 data-col-2>

| Input | ID | Type | Description |
| :--- | :--- | :--- | :--- |
| Task ID (required) | `task` | string | `TASK_CREATE_TICKET` |
| Owner ID | `owner-id` | string | The user who is assigned to the object |
| Ticket Name (required) | `ticket-name` | string | Ticket name |
| Ticket Status (required) | `ticket-status` | string | The pipeline stage that contains this ticket. Default format is number. Example: 1. However, remember to check internal value for custom fields. Note: In Instill AI, ticket-status is displayed as string because of the possible custom internal value. |
| Pipeline (required) | `pipeline` | string | A pipeline organizes and tracks the progression of tickets through various stages of resolution within your support process. HubSpot uses interval value rather than the name displayed in the view |
| Categories | `categories` | array[string] | The main reason customer reached out for help. Default format is in capital letters. Example: BILLING_ISSUE. However, remember to check internal value for custom fields. |
| Priority | `priority` | string | The level of attention needed on the ticket. Default format is in capital letters. Example: MEDIUM. However, remember to check internal value for custom fields. |
| Source | `source` | string | Channel where ticket was originally submitted. Default format is in capital letters. Example: EMAIL |
| Create Object -> Contact Association using contact IDs | `create-contacts-association` | array[string] | Existing contact IDs to be associated with the object |
</div>






<div class="markdown-col-no-wrap" data-col-1 data-col-2>

| Output | ID | Type | Description |
| :--- | :--- | :--- | :--- |
| Ticket ID | `ticket-id` | string | Ticket ID |
</div>

### Update Ticket

Update existing ticket

<div class="markdown-col-no-wrap" data-col-1 data-col-2>

| Input | ID | Type | Description |
| :--- | :--- | :--- | :--- |
| Task ID (required) | `task` | string | `TASK_UPDATE_TICKET` |
| Owner ID | `owner-id` | string | The user who is assigned to the object |
| Ticket ID (required) | `ticket-id` | string | Input ticket ID |
| Ticket Name | `ticket-name` | string | Ticket name |
| Ticket Status | `ticket-status` | string | The pipeline stage that contains this ticket. Default format is number. Example: 1. However, remember to check internal value for custom fields. Note: In Instill AI, ticket-status is displayed as string because of the possible custom internal value. |
| Pipeline | `pipeline` | string | A pipeline organizes and tracks the progression of tickets through various stages of resolution within your support process. HubSpot uses interval value rather than the name displayed in the view |
| Categories | `categories` | array[string] | The main reason customer reached out for help. Default format is in capital letters. Example: BILLING_ISSUE. However, remember to check internal value for custom fields. |
| Priority | `priority` | string | The level of attention needed on the ticket. Default format is in capital letters. Example: MEDIUM. However, remember to check internal value for custom fields. |
| Source | `source` | string | Channel where ticket was originally submitted. Default format is in capital letters. Example: EMAIL |
| Create Object -> Contact Association using contact IDs | `create-contacts-association` | array[string] | Existing contact IDs to be associated with the object |
</div>






<div class="markdown-col-no-wrap" data-col-1 data-col-2>

| Output | ID | Type | Description |
| :--- | :--- | :--- | :--- |
| Updated At | `updated-at` | string | The time when the ticket was updated |
</div>

### Get Thread

Retrieve all the messages inside a thread (conversation inbox). The messages will be sorted from most recent to least recent. Note: This task uses Conversation API from HubSpot, which is still in BETA.

<div class="markdown-col-no-wrap" data-col-1 data-col-2>

| Input | ID | Type | Description |
| :--- | :--- | :--- | :--- |
| Task ID (required) | `task` | string | `TASK_GET_THREAD` |
| Thread ID (required) | `thread-id` | string | Input thread ID |
</div>






<div class="markdown-col-no-wrap" data-col-1 data-col-2>

| Output | ID | Type | Description |
| :--- | :--- | :--- | :--- |
| [Messages](#get-thread-messages) | `results` | array[object] | An array of messages |
| Number of Messages | `no-of-messages` | integer | The number of messages in a thread |
</div>

<details>
<summary> Output Objects in Get Thread</summary>

<h4 id="get-thread-messages">Messages</h4>

<div class="markdown-col-no-wrap" data-col-1 data-col-2>

| Field | Field ID | Type | Note |
| :--- | :--- | :--- | :--- |
| Channel Account ID | `channel-account-id` | string | The ID of an account that is part of the channel-id channel. |
| Channel ID | `channel-id` | string | The ID of a generic channel returned from the channels endpoint, like 1000 for live chat, 1001 for Facebook Messenger, 1002 for email, etc. |
| Start Conversation Message | `created-at` | string | message to start a conversation |
| [Recipients](#get-thread-recipients) | `recipients` | array | Recipients' information |
| [Sender](#get-thread-sender) | `sender` | object | Sender's information |
| Subject | `subject` | string | The subject of the message |
| Text | `text` | string | The content of the message |
</div>

<h4 id="get-thread-sender">Sender</h4>

<div class="markdown-col-no-wrap" data-col-1 data-col-2>

| Field | Field ID | Type | Note |
| :--- | :--- | :--- | :--- |
| Actor ID | `sender-actor-id` | string | The actor ID of the sender |
| Name | `sender-name` | string | The name of the sender |
| Type | `sender-type` | string | Specify the category of sender information |
| Value | `sender-value` | string | Contains the actual sender information (e.g.: email address) |
</div>

<h4 id="get-thread-recipients">Recipients</h4>

<div class="markdown-col-no-wrap" data-col-1 data-col-2>

| Field | Field ID | Type | Note |
| :--- | :--- | :--- | :--- |
| Name | `name` | string | The name of the recipient |
| Type | `type` | string | Specify the category of recipient information |
| Value | `value` | string | Contains the actual recipient information (e.g.: email address) |
</div>
</details>

### Insert Message

Insert message into a thread (only support email thread)

<div class="markdown-col-no-wrap" data-col-1 data-col-2>

| Input | ID | Type | Description |
| :--- | :--- | :--- | :--- |
| Task ID (required) | `task` | string | `TASK_INSERT_MESSAGE` |
| Thread ID (required) | `thread-id` | string | Input thread ID |
| Sender Actor ID (required) | `sender-actor-id` | string | Input sender actor id. Example: A-12345678. To obtain this, it is recommended to use and copy the 'Get Thread task' sender output. For [more information](https://developers.hubspot.com/beta-docs/guides/api/conversations/inbox-and-messages#get-actors) about actor id |
| Recipients (required) | `recipients` | array[string] | Recipients of the message |
| Channel Account ID (required) | `channel-account-id` | string | The ID of an account that is part of the channel-id channel. On an existing thread, it is recommended to copy channel-account-id of the most recent message on the thread. |
| Subject (required) | `subject` | string | The subject of the message |
| Text (required) | `text` | string | The body of the message |
</div>






<div class="markdown-col-no-wrap" data-col-1 data-col-2>

| Output | ID | Type | Description |
| :--- | :--- | :--- | :--- |
| Status | `status` | string | The message status |
</div>

### Retrieve Association

Get the object IDs associated with contact ID (contact->objects). If you are trying to do the opposite (object->contacts), it is possible using the other tasks. Example: Go to get deal task to obtain deal->contacts. Remember to check that the contact ID you input exists, because there won't be an error message if the contact ID doesn't exist.

<div class="markdown-col-no-wrap" data-col-1 data-col-2>

| Input | ID | Type | Description |
| :--- | :--- | :--- | :--- |
| Task ID (required) | `task` | string | `TASK_RETRIEVE_ASSOCIATION` |
| Contact ID (required) | `contact-id` | string | Input contact ID |
| Object Type (required) | `object-type` | string | Input object type (CRM objects or 'Threads'). Note: CRM objects include 'Deals', 'Companies', 'Tickets', etc |
</div>






<div class="markdown-col-no-wrap" data-col-1 data-col-2>

| Output | ID | Type | Description |
| :--- | :--- | :--- | :--- |
| Object ID Array  | `object-ids` | array[string] | An array of object ID associated with the contact |
| Object IDs Length | `object-ids-length` | integer | The number of object IDs |
</div>

### Get Owner

Get information about HubSpot owner using either owner ID or user ID. For more information about owner, please go to [here](https://developers.hubspot.com/docs/api/crm/owners)

<div class="markdown-col-no-wrap" data-col-1 data-col-2>

| Input | ID | Type | Description |
| :--- | :--- | :--- | :--- |
| Task ID (required) | `task` | string | `TASK_GET_OWNER` |
| ID Type (required) | `id-type` | string | Specify the type of ID you will use to get owner's information. |
| ID (required) | `id` | string | Can either be owner ID or user ID; according to the ID type you selected. |
</div>






<div class="markdown-col-no-wrap" data-col-1 data-col-2>

| Output | ID | Type | Description |
| :--- | :--- | :--- | :--- |
| First Name | `first-name` | string | First name |
| Last Name | `last-name` | string | Last name |
| Email | `email` | string | Email |
| Owner ID | `owner-id` | string | Owner ID. Usually used to associate the owner with other objects. |
| User ID | `user-id` | string | User ID. Usually used to indicate the owner who performed the action. User ID can be seen in Update Deal task output. |
| [Teams](#get-owner-teams) (optional) | `teams` | array[object] | The owner's teams information |
| Created At | `created-at` | string | Created at |
| Updated At | `updated-at` | string | Updated at |
| Archived | `archived` | boolean | Archived |
</div>

<details>
<summary> Output Objects in Get Owner</summary>

<h4 id="get-owner-teams">Teams</h4>

<div class="markdown-col-no-wrap" data-col-1 data-col-2>

| Field | Field ID | Type | Note |
| :--- | :--- | :--- | :--- |
| Team ID | `team-id` | string | The ID of the team |
| Team Name | `team-name` | string | The name of the team |
| Team Primary | `team-primary` | boolean | Indicate whether this team is the primary team of the owner |
</div>
</details>

### Get All

Get all the IDs for a specific object (e.g. all contact IDs)

<div class="markdown-col-no-wrap" data-col-1 data-col-2>

| Input | ID | Type | Description |
| :--- | :--- | :--- | :--- |
| Task ID (required) | `task` | string | `TASK_GET_ALL` |
| Object Type (required) | `object-type` | string | The object which you want to get all IDs for |
</div>






<div class="markdown-col-no-wrap" data-col-1 data-col-2>

| Output | ID | Type | Description |
| :--- | :--- | :--- | :--- |
| Object ID Array  | `object-ids` | array[string] | An array of object ID |
| Object IDs Length | `object-ids-length` | integer | The number of object IDs |
</div>

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateAssociation

func CreateAssociation(fromID *string, toIDs *[]string, fromObjectType string, toObjectType string, e *execution) error

func Init

func Init(bc base.Component) *component

Types

type CreateAssociationReq

type CreateAssociationReq struct {
	Associations []association `json:"inputs"`
}

type CreateAssociationResponse

type CreateAssociationResponse struct {
	Status string `json:"status"`
}

type CustomClient

type CustomClient struct {
	*hubspot.Client
	Thread              ThreadService
	RetrieveAssociation RetrieveAssociationService
	Ticket              TicketService
	Owner               OwnerService
	GetAll              GetAllService
}

need to create CustomClient because the go-hubspot sdk we are using does not support threads (conversation inbox) future functionalities that go-huspot sdk doesn't support will go here or need to be modified will go here.

func NewCustomClient

func NewCustomClient(setAuthMethod hubspot.AuthMethod, opts ...hubspot.Option) (*CustomClient, error)

type GetAllService

type GetAllService interface {
	Get(objectType string, param string) (*TaskGetAllResp, error)
}

type GetAllServiceOp

type GetAllServiceOp struct {
	// contains filtered or unexported fields
}

func (*GetAllServiceOp) Get

func (s *GetAllServiceOp) Get(objectType string, param string) (*TaskGetAllResp, error)

type OwnerService

type OwnerService interface {
	Get(ownerInfo string, infoType string) (*TaskGetOwnerResp, error)
}

type OwnerServiceOp

type OwnerServiceOp struct {
	// contains filtered or unexported fields
}

func (*OwnerServiceOp) Get

func (s *OwnerServiceOp) Get(ownerInfo string, infoType string) (*TaskGetOwnerResp, error)

type RetrieveAssociationService

type RetrieveAssociationService interface {
	GetThreadID(contactID string, paging bool, pagingPath string) (*TaskRetrieveAssociationThreadResp, error)
	GetCrmID(contactID string, objectType string, paging bool, pagingPath string) (interface{}, error)
}

type RetrieveAssociationServiceOp

type RetrieveAssociationServiceOp struct {
	// contains filtered or unexported fields
}

func (*RetrieveAssociationServiceOp) GetCrmID

func (s *RetrieveAssociationServiceOp) GetCrmID(contactID string, objectType string, paging bool, pagingPath string) (interface{}, error)

func (*RetrieveAssociationServiceOp) GetThreadID

func (s *RetrieveAssociationServiceOp) GetThreadID(contactID string, paging bool, pagingPath string) (*TaskRetrieveAssociationThreadResp, error)

type TaskCreateCompanyInput

type TaskCreateCompanyInput struct {
	OwnerID                   string   `json:"owner-id"`
	CompanyName               string   `json:"company-name"`
	CompanyDomain             string   `json:"company-domain"`
	Description               string   `json:"description"`
	PhoneNumber               string   `json:"phone-number"`
	Industry                  string   `json:"industry"`
	CompanyType               string   `json:"company-type"`
	City                      string   `json:"city"`
	State                     string   `json:"state"`
	Country                   string   `json:"country"`
	PostalCode                string   `json:"postal-code"`
	TimeZone                  string   `json:"time-zone"`
	AnnualRevenue             float64  `json:"annual-revenue"`
	LinkedinPage              string   `json:"linkedin-page"`
	CreateContactsAssociation []string `json:"create-contacts-association"`
}

Create Company

type TaskCreateCompanyOutput

type TaskCreateCompanyOutput struct {
	CompanyID string `json:"company-id"`
}

type TaskCreateCompanyReq

type TaskCreateCompanyReq struct {
	OwnerID       string `json:"hubspot_owner_id,omitempty"`
	CompanyName   string `json:"name,omitempty"`
	CompanyDomain string `json:"domain,omitempty"`
	Description   string `json:"description,omitempty"`
	PhoneNumber   string `json:"phone,omitempty"`
	Industry      string `json:"industry,omitempty"`
	CompanyType   string `json:"type,omitempty"`
	City          string `json:"city,omitempty"`
	State         string `json:"state,omitempty"`
	Country       string `json:"country,omitempty"`
	PostalCode    string `json:"zip,omitempty"`
	TimeZone      string `json:"timezone,omitempty"`
	AnnualRevenue string `json:"annualrevenue,omitempty"`
	LinkedinPage  string `json:"linkedin_company_page,omitempty"`
	CompanyID     string `json:"hs_object_id"`
}

type TaskCreateContactInput

type TaskCreateContactInput struct {
	OwnerID                    string   `json:"owner-id"`
	Email                      string   `json:"email"`
	FirstName                  string   `json:"first-name"`
	LastName                   string   `json:"last-name"`
	PhoneNumber                string   `json:"phone-number"`
	Company                    string   `json:"company"`
	JobTitle                   string   `json:"job-title"`
	LifecycleStage             string   `json:"lifecycle-stage"`
	LeadStatus                 string   `json:"lead-status"`
	CreateDealsAssociation     []string `json:"create-deals-association"`
	CreateCompaniesAssociation []string `json:"create-companies-association"`
	CreateTicketsAssociation   []string `json:"create-tickets-association"`
}

type TaskCreateContactOutput

type TaskCreateContactOutput struct {
	ContactID string `json:"contact-id"`
}

type TaskCreateContactReq

type TaskCreateContactReq struct {
	OwnerID        string `json:"hubspot_owner_id,omitempty"`
	Email          string `json:"email,omitempty"`
	FirstName      string `json:"firstname,omitempty"`
	LastName       string `json:"lastname,omitempty"`
	PhoneNumber    string `json:"phone,omitempty"`
	Company        string `json:"company,omitempty"`
	JobTitle       string `json:"jobtitle,omitempty"`
	LifecycleStage string `json:"lifecyclestage,omitempty"`
	LeadStatus     string `json:"hs_lead_status,omitempty"`
	ContactID      string `json:"hs_object_id"`
}

type TaskCreateDealInput

type TaskCreateDealInput struct {
	OwnerID                   string   `json:"owner-id"`
	DealName                  string   `json:"deal-name"`
	Pipeline                  string   `json:"pipeline"`
	DealStage                 string   `json:"deal-stage"`
	Amount                    float64  `json:"amount"`
	DealType                  string   `json:"deal-type"`
	CloseDate                 string   `json:"close-date"`
	CreateContactsAssociation []string `json:"create-contacts-association"`
}

type TaskCreateDealOutput

type TaskCreateDealOutput struct {
	DealID string `json:"deal-id"`
}

type TaskCreateDealReq

type TaskCreateDealReq struct {
	OwnerID   string `json:"hubspot_owner_id,omitempty"`
	DealName  string `json:"dealname"`
	Pipeline  string `json:"pipeline"`
	DealStage string `json:"dealstage"`
	Amount    string `json:"amount,omitempty"`
	DealType  string `json:"dealtype,omitempty"`
	CloseDate string `json:"closedate,omitempty"`
	DealID    string `json:"hs_object_id"`
}

type TaskCreateTicketInput

type TaskCreateTicketInput struct {
	OwnerID                   string   `json:"owner-id"`
	TicketName                string   `json:"ticket-name"`
	TicketStatus              string   `json:"ticket-status"`
	Pipeline                  string   `json:"pipeline"`
	Category                  []string `json:"categories"`
	Priority                  string   `json:"priority"`
	Source                    string   `json:"source"`
	CreateContactsAssociation []string `json:"create-contacts-association"`
}

Create Ticket

type TaskCreateTicketOutput

type TaskCreateTicketOutput struct {
	TicketID string `json:"ticket-id"`
}

type TaskCreateTicketReq

type TaskCreateTicketReq struct {
	OwnerID      string `json:"hubspot_owner_id,omitempty"`
	TicketName   string `json:"subject"`
	TicketStatus string `json:"hs_pipeline_stage"`
	Pipeline     string `json:"hs_pipeline"`
	Category     string `json:"hs_ticket_category,omitempty"`
	Priority     string `json:"hs_ticket_priority,omitempty"`
	Source       string `json:"source_type,omitempty"`
	TicketID     string `json:"hs_object_id"`
}

type TaskGetAllInput

type TaskGetAllInput struct {
	ObjectType string `json:"object-type"`
}

type TaskGetAllOutput

type TaskGetAllOutput struct {
	ObjectIDs       []string `json:"object-ids"`
	ObjectIDsLength int      `json:"object-ids-length"`
}

type TaskGetAllResp

type TaskGetAllResp struct {
	Results []taskGetAllRespResult `json:"results"`
	Paging  *taskGetAllRespPaging  `json:"paging,omitempty"`
}

type TaskGetCompanyInput

type TaskGetCompanyInput struct {
	CompanyID string `json:"company-id"`
}

Get Company

type TaskGetCompanyOutput

type TaskGetCompanyOutput struct {
	OwnerID              string   `json:"owner-id,omitempty"`
	CompanyName          string   `json:"company-name,omitempty"`
	CompanyDomain        string   `json:"company-domain,omitempty"`
	Description          string   `json:"description,omitempty"`
	PhoneNumber          string   `json:"phone-number,omitempty"`
	Industry             string   `json:"industry,omitempty"`
	CompanyType          string   `json:"company-type,omitempty"`
	City                 string   `json:"city,omitempty"`
	State                string   `json:"state,omitempty"`
	Country              string   `json:"country,omitempty"`
	PostalCode           string   `json:"postal-code,omitempty"`
	TimeZone             string   `json:"time-zone,omitempty"`
	AnnualRevenue        float64  `json:"annual-revenue,omitempty"`
	TotalRevenue         float64  `json:"total-revenue,omitempty"`
	LinkedinPage         string   `json:"linkedin-page,omitempty"`
	AssociatedContactIDs []string `json:"associated-contact-ids"`
}

type TaskGetCompanyResp

type TaskGetCompanyResp struct {
	OwnerID       string `json:"hubspot_owner_id,omitempty"`
	CompanyName   string `json:"name,omitempty"`
	CompanyDomain string `json:"domain,omitempty"`
	Description   string `json:"description,omitempty"`
	PhoneNumber   string `json:"phone,omitempty"`
	Industry      string `json:"industry,omitempty"`
	CompanyType   string `json:"type,omitempty"`
	City          string `json:"city,omitempty"`
	State         string `json:"state,omitempty"`
	Country       string `json:"country,omitempty"`
	PostalCode    string `json:"zip,omitempty"`
	TimeZone      string `json:"timezone,omitempty"`
	AnnualRevenue string `json:"annualrevenue,omitempty"`
	TotalRevenue  string `json:"totalrevenue,omitempty"`
	LinkedinPage  string `json:"linkedin_company_page,omitempty"`
}

type TaskGetContactInput

type TaskGetContactInput struct {
	ContactIDOrEmail string `json:"contact-id-or-email"`
}

type TaskGetContactOutput

type TaskGetContactOutput struct {
	OwnerID        string `json:"owner-id,omitempty"`
	Email          string `json:"email,omitempty"`
	FirstName      string `json:"first-name,omitempty"`
	LastName       string `json:"last-name,omitempty"`
	PhoneNumber    string `json:"phone-number,omitempty"`
	Company        string `json:"company,omitempty"`
	JobTitle       string `json:"job-title,omitempty"`
	LifecycleStage string `json:"lifecycle-stage,omitempty"`
	LeadStatus     string `json:"lead-status,omitempty"`
	ContactID      string `json:"contact-id"`
}

type TaskGetContactResp

type TaskGetContactResp struct {
	OwnerID        string `json:"hubspot_owner_id,omitempty"`
	Email          string `json:"email,omitempty"`
	FirstName      string `json:"firstname,omitempty"`
	LastName       string `json:"lastname,omitempty"`
	PhoneNumber    string `json:"phone,omitempty"`
	Company        string `json:"company,omitempty"`
	JobTitle       string `json:"jobtitle,omitempty"`
	LifecycleStage string `json:"lifecyclestage,omitempty"`
	LeadStatus     string `json:"hs_lead_status,omitempty"`
	ContactID      string `json:"hs_object_id"`
}

type TaskGetDealInput

type TaskGetDealInput struct {
	DealID string `json:"deal-id"`
}

type TaskGetDealOutput

type TaskGetDealOutput struct {
	OwnerID              string   `json:"owner-id,omitempty"`
	DealName             string   `json:"deal-name"`
	Pipeline             string   `json:"pipeline"`
	DealStage            string   `json:"deal-stage"`
	Amount               float64  `json:"amount,omitempty"`
	DealType             string   `json:"deal-type,omitempty"`
	CreateDate           string   `json:"create-date"`
	CloseDate            string   `json:"close-date,omitempty"`
	AssociatedContactIDs []string `json:"associated-contact-ids"`
}

type TaskGetDealResp

type TaskGetDealResp struct {
	OwnerID    string          `json:"hubspot_owner_id,omitempty"`
	DealName   string          `json:"dealname"`
	Pipeline   string          `json:"pipeline"`
	DealStage  string          `json:"dealstage"`
	Amount     string          `json:"amount,omitempty"`
	DealType   string          `json:"dealtype,omitempty"`
	CloseDate  *hubspot.HsTime `json:"closedate,omitempty"`
	CreateDate *hubspot.HsTime `json:"createdate"`
}

type TaskGetOwnerInputstruct

type TaskGetOwnerInputstruct struct {
	IDType string `json:"id-type"`
	ID     string `json:"id"`
}

type TaskGetOwnerOutput

type TaskGetOwnerOutput struct {
	FirstName string                   `json:"first-name"`
	LastName  string                   `json:"last-name"`
	Email     string                   `json:"email"`
	OwnerID   string                   `json:"owner-id"`
	UserID    string                   `json:"user-id"` //UserID can be string in other hubspot schema. I will stick to string as well so that it is consistent with other ID types
	Teams     []taskGetOwnerOutputTeam `json:"teams,omitempty"`

	CreatedAt string `json:"created-at"`
	UpdatedAt string `json:"updated-at"`
	Archived  bool   `json:"archived"`
}

type TaskGetOwnerResp

type TaskGetOwnerResp struct {
	FirstName string                 `json:"firstName"`
	LastName  string                 `json:"lastName"`
	Email     string                 `json:"email"`
	OwnerID   string                 `json:"id"`
	UserID    int                    `json:"userId"`
	Teams     []taskGetOwnerRespTeam `json:"teams,omitempty"`

	CreatedAt *hubspot.HsTime `json:"createdAt"`
	UpdatedAt *hubspot.HsTime `json:"updatedAt"`
	Archived  bool            `json:"archived"`
}

type TaskGetThreadInput

type TaskGetThreadInput struct {
	ThreadID string `json:"thread-id"`
}

type TaskGetThreadOutput

type TaskGetThreadOutput struct {
	Results      []taskGetThreadOutputResult `json:"results"`
	NoOfMessages int                         `json:"no-of-messages"`
}

type TaskGetThreadResp

type TaskGetThreadResp struct {
	Results []taskGetThreadRespResult `json:"results"`
	Paging  *taskGetThreadRespPaging  `json:"paging,omitempty"`
}

type TaskGetTicketInput

type TaskGetTicketInput struct {
	TicketID string `json:"ticket-id"`
}

type TaskGetTicketOutput

type TaskGetTicketOutput struct {
	OwnerID              string   `json:"owner-id,omitempty"`
	TicketName           string   `json:"ticket-name"`
	TicketStatus         string   `json:"ticket-status"`
	Pipeline             string   `json:"pipeline"`
	Category             []string `json:"categories"`
	Priority             string   `json:"priority,omitempty"`
	Source               string   `json:"source,omitempty"`
	RecordSource         string   `json:"record-source,omitempty"`
	CreateDate           string   `json:"create-date"`
	LastModifiedDate     string   `json:"last-modified-date"`
	AssociatedContactIDs []string `json:"associated-contact-ids"`
}

type TaskGetTicketResp

type TaskGetTicketResp struct {
	OwnerID          string          `json:"hubspot_owner_id,omitempty"`
	TicketName       string          `json:"subject"`
	TicketStatus     string          `json:"hs_pipeline_stage"`
	Pipeline         string          `json:"hs_pipeline"`
	Category         string          `json:"hs_ticket_category,omitempty"`
	Priority         string          `json:"hs_ticket_priority,omitempty"`
	Source           string          `json:"source_type,omitempty"`
	RecordSource     string          `json:"hs_object_source_label,omitempty"`
	CreateDate       *hubspot.HsTime `json:"createdate"`
	LastModifiedDate *hubspot.HsTime `json:"hs_lastmodifieddate"`
	TicketID         string          `json:"hs_object_id"`
}

type TaskInsertMessageInput

type TaskInsertMessageInput struct {
	ThreadID         string   `json:"thread-id"`
	SenderActorID    string   `json:"sender-actor-id"`
	Recipients       []string `json:"recipients"`
	ChannelAccountID string   `json:"channel-account-id"`
	Subject          string   `json:"subject"`
	Text             string   `json:"text"`
}

type TaskInsertMessageOutput

type TaskInsertMessageOutput struct {
	Status string `json:"status"`
}

type TaskInsertMessageReq

type TaskInsertMessageReq struct {
	Type             string                          `json:"type"`
	Text             string                          `json:"text"` //content of the message
	Recipients       []taskInsertMessageReqRecipient `json:"recipients"`
	SenderActorID    string                          `json:"senderActorId"`
	ChannelID        string                          `json:"channelId"`
	ChannelAccountID string                          `json:"channelAccountId"`
	Subject          string                          `json:"subject"`
}

type TaskInsertMessageResp

type TaskInsertMessageResp struct {
	Status  taskInsertMessageRespStatusType `json:"status"`
	Message string                          `json:"message,omitempty"`
}

type TaskRetrieveAssociationCrmPagingResp

type TaskRetrieveAssociationCrmPagingResp struct {
	Results []struct {
		ID string `json:"id"`
	} `json:"results"`
	Paging *taskRetrieveAssociationRespPaging `json:"paging,omitempty"`
}

type TaskRetrieveAssociationCrmReq

type TaskRetrieveAssociationCrmReq struct {
	Input []TaskRetrieveAssociationCrmReqID `json:"inputs"`
}

type TaskRetrieveAssociationCrmReqID

type TaskRetrieveAssociationCrmReqID struct {
	ContactID string `json:"id"`
}

type TaskRetrieveAssociationCrmResp

type TaskRetrieveAssociationCrmResp struct {
	Results []taskRetrieveAssociationCrmRespResult `json:"results"`
}

type TaskRetrieveAssociationInput

type TaskRetrieveAssociationInput struct {
	ContactID  string `json:"contact-id"`
	ObjectType string `json:"object-type"`
}

type TaskRetrieveAssociationOutput

type TaskRetrieveAssociationOutput struct {
	ObjectIDs       []string `json:"object-ids"`
	ObjectIDsLength int      `json:"object-ids-length"`
}

type TaskRetrieveAssociationThreadResp

type TaskRetrieveAssociationThreadResp struct {
	Results []struct {
		ID string `json:"id"`
	} `json:"results"`
	Paging *taskRetrieveAssociationRespPaging `json:"paging,omitempty"`
}

type TaskUpdateDealInput

type TaskUpdateDealInput struct {
	DealID                    string   `json:"deal-id"`
	OwnerID                   string   `json:"owner-id,omitempty"`
	DealName                  string   `json:"deal-name"`
	Pipeline                  string   `json:"pipeline"`
	DealStage                 string   `json:"deal-stage"`
	Amount                    float64  `json:"amount"`
	DealType                  string   `json:"deal-type"`
	CloseDate                 string   `json:"close-date"`
	CreateContactsAssociation []string `json:"create-contacts-association"`
}

type TaskUpdateDealOutput

type TaskUpdateDealOutput struct {
	UpdatedByUserID string `json:"updated-by-user-id"`
	UpdatedAt       string `json:"updated-at"` //mostly just used to signal that it is updated successfully.
}

type TaskUpdateDealReq

type TaskUpdateDealReq struct {
	OwnerID         string `json:"hubspot_owner_id,omitempty"`
	DealName        string `json:"dealname"`
	Pipeline        string `json:"pipeline"`
	DealStage       string `json:"dealstage"`
	Amount          string `json:"amount,omitempty"`
	DealType        string `json:"dealtype,omitempty"`
	CloseDate       string `json:"closedate,omitempty"`
	UpdatedByUserID string `json:"hs_updated_by_user_id,omitempty"`
}

type TaskUpdateTicketInput

type TaskUpdateTicketInput struct {
	TicketID                  string   `json:"ticket-id"`
	OwnerID                   string   `json:"owner-id"`
	TicketName                string   `json:"ticket-name"`
	TicketStatus              string   `json:"ticket-status"`
	Pipeline                  string   `json:"pipeline"`
	Category                  []string `json:"categories"`
	Priority                  string   `json:"priority"`
	Source                    string   `json:"source"`
	CreateContactsAssociation []string `json:"create-contacts-association"`
}

Update Ticket

type TaskUpdateTicketOutput

type TaskUpdateTicketOutput struct {
	UpdatedAt string `json:"updated-at"` //mostly just used to signal that it is updated successfully.

} // unlike UpdateDeal, UpdateTicket doesn't have UpdatedByUserID because the API response doesn't return that value for some reason.

type TaskUpdateTicketReq

type TaskUpdateTicketReq struct {
	OwnerID      string `json:"hubspot_owner_id,omitempty"`
	TicketName   string `json:"subject"`
	TicketStatus string `json:"hs_pipeline_stage"`
	Pipeline     string `json:"hs_pipeline"`
	Category     string `json:"hs_ticket_category,omitempty"`
	Priority     string `json:"hs_ticket_priority,omitempty"`
	Source       string `json:"source_type,omitempty"`
}

type ThreadService

type ThreadService interface {
	Get(threadID string, param string) (*TaskGetThreadResp, error)
	Insert(threadID string, message *TaskInsertMessageReq) (*TaskInsertMessageResp, error)
}

type ThreadServiceOp

type ThreadServiceOp struct {
	// contains filtered or unexported fields
}

func (*ThreadServiceOp) Get

func (s *ThreadServiceOp) Get(threadID string, param string) (*TaskGetThreadResp, error)

func (*ThreadServiceOp) Insert

func (s *ThreadServiceOp) Insert(threadID string, message *TaskInsertMessageReq) (*TaskInsertMessageResp, error)

type TicketService

type TicketService interface {
	Get(ticketID string) (*hubspot.ResponseResource, error)
	Create(ticket *TaskCreateTicketReq) (*hubspot.ResponseResource, error)
	Update(ticketID string, ticket *TaskUpdateTicketReq) (*hubspot.ResponseResource, error)
}

type TicketServiceOp

type TicketServiceOp struct {
	// contains filtered or unexported fields
}

func (*TicketServiceOp) Create

func (*TicketServiceOp) Get

func (s *TicketServiceOp) Get(ticketID string) (*hubspot.ResponseResource, error)

func (*TicketServiceOp) Update

func (s *TicketServiceOp) Update(ticketID string, ticket *TaskUpdateTicketReq) (*hubspot.ResponseResource, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL