hubspot

package
v0.24.1-beta Latest Latest
Warning

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

Go to latest
Published: Aug 5, 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)
- [Get Company](#get-company)
- [Create Company](#create-company)
- [Get Ticket](#get-ticket)
- [Create Ticket](#create-ticket)
- [Get Thread](#get-thread)
- [Insert Message](#insert-message)
- [Retrieve Association](#retrieve-association)



## Release Stage

`Alpha`



## Configuration

The component configuration is defined and maintained [here](https://github.com/instill-ai/component/blob/main/application/hubspot/v0/config/definition.json).




## Setup


| 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 |




## Supported Tasks

### Get Contact

Get contact information using contact ID or Email


| 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 |



| 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 |






### Create Contact

Create new contact


| 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 |



| Output | ID | Type | Description |
| :--- | :--- | :--- | :--- |
| Contact ID | `contact-id` | string | Contact ID |






### Get Deal

Get deal information using deal ID


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



| 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 |






### Create Deal

Create new deal


| 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 |



| Output | ID | Type | Description |
| :--- | :--- | :--- | :--- |
| Deal ID | `deal-id` | string | Deal ID |






### Get Company

Get company information using company ID


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



| 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 |






### Create Company

Create new company


| 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 |



| Output | ID | Type | Description |
| :--- | :--- | :--- | :--- |
| Company ID | `company-id` | string | Company ID |






### Get Ticket

Get ticket information using ticket ID


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



| 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 |






### Create Ticket

Create new ticket


| 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 |



| Output | ID | Type | Description |
| :--- | :--- | :--- | :--- |
| Ticket ID | `ticket-id` | string | Ticket ID |






### 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.


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



| Output | ID | Type | Description |
| :--- | :--- | :--- | :--- |
| Messages | `results` | array[object] | An array of messages |






### Insert Message

Insert message into a thread (only support email thread)


| 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 about actor id: https://developers.hubspot.com/beta-docs/guides/api/conversations/inbox-and-messages#get-actors |
| 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 |



| Output | ID | Type | Description |
| :--- | :--- | :--- | :--- |
| Status | `status` | string | The message status |






### 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


| 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 |



| Output | ID | Type | Description |
| :--- | :--- | :--- | :--- |
| Object ID Array  | `object-ids` | array[string] | An array of object ID associated with the contact |







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
}

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 RetrieveAssociationService

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

type RetrieveAssociationServiceOp

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

func (*RetrieveAssociationServiceOp) GetCrmID

func (s *RetrieveAssociationServiceOp) GetCrmID(contactID string, objectType string) (*TaskRetrieveAssociationCrmResp, error)

func (*RetrieveAssociationServiceOp) GetThreadID

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 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,omitempty"`
}

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,omitempty"`
}

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  string `json:"closedate,omitempty"`
	CreateDate string `json:"createdate"`
}

type TaskGetThreadInput

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

type TaskGetThreadOutput

type TaskGetThreadOutput struct {
	Results []taskGetThreadOutputResult `json:"results"`
}

type TaskGetThreadResp

type TaskGetThreadResp struct {
	Results []taskGetThreadRespResult `json:"results"`
}

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,omitempty"`
	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,omitempty"`
}

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       string `json:"createdate"`
	LastModifiedDate string `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 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"`
}

type TaskRetrieveAssociationThreadResp

type TaskRetrieveAssociationThreadResp struct {
	Results []struct {
		ID string `json:"id"`
	} `json:"results"`
}

type ThreadService

type ThreadService interface {
	Get(threadID 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) (*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)
}

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)

Jump to

Keyboard shortcuts

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