Documentation ¶
Index ¶
- Constants
- func CheckResponse(r *http.Response) error
- func DumpRequest(req *http.Request, showBody bool)
- func NewContactListOptions(listCount, offset int) *contactListsOptions
- type APIKeyAuth
- type Authenticator
- type CompaniesService
- type Company
- type CompanyProperties
- type CompanyPropertiesService
- func (s *CompanyPropertiesService) Create(property ItemProperty) (*ItemProperty, error)
- func (s *CompanyPropertiesService) CreateGroup(group ItemPropertyGroup) (*ItemPropertyGroup, error)
- func (s *CompanyPropertiesService) Delete(name string) error
- func (s *CompanyPropertiesService) DeleteGroup(name string) error
- func (s *CompanyPropertiesService) GetAll() (*ItemProperties, error)
- func (s *CompanyPropertiesService) GetByName(name string) (*ItemProperty, error)
- func (s *CompanyPropertiesService) GetGroups() (*ItemPropertyGroups, error)
- func (s *CompanyPropertiesService) Update(name string, update ItemProperty) (*ItemProperty, error)
- func (s *CompanyPropertiesService) UpdateGroup(name string, update ItemPropertyGroup) (*ItemPropertyGroup, error)
- type ComputedProperty
- type Contact
- type ContactDeleteResult
- type ContactFilterItem
- type ContactList
- type ContactLists
- type ContactListsService
- type ContactOperator
- type ContactPropertiesService
- func (s *ContactPropertiesService) Create(property ItemProperty) (*ItemProperty, error)
- func (s *ContactPropertiesService) CreateGroup(group ItemPropertyGroup) (*ItemPropertyGroup, error)
- func (s *ContactPropertiesService) Delete(name string) error
- func (s *ContactPropertiesService) DeleteGroup(name string) error
- func (s *ContactPropertiesService) GetAll() (*ItemProperties, error)
- func (s *ContactPropertiesService) GetByName(name string) (*ItemProperty, error)
- func (s *ContactPropertiesService) GetGroups() (*ItemPropertyGroups, error)
- func (s *ContactPropertiesService) Update(name string, update ItemProperty) (*ItemProperty, error)
- func (s *ContactPropertiesService) UpdateGroup(name string, update ItemPropertyGroup) (*ItemPropertyGroup, error)
- type ContactsService
- func (s *ContactsService) Create(properties Properties) (*IdentityProfile, error)
- func (s *ContactsService) CreateOrUpdateByEmail(email string, properties Properties) (*Vid, error)
- func (s *ContactsService) DeleteById(id int) (*ContactDeleteResult, error)
- func (s *ContactsService) GetById(contactID int) (*Contact, error)
- func (s *ContactsService) GetByToken(token string) (*Contact, error)
- func (s *ContactsService) Merge(primaryID, secondaryID int) error
- func (s *ContactsService) Update(contactID int, properties Properties) error
- func (s *ContactsService) UpdateByEmail(email string, properties Properties) error
- type EventsFilterItem
- type EventsOpeerator
- type Filter
- type FilterItem
- type FilterOperator
- type Filters
- type FormService
- func (s *FormService) AddOption(key, value string) *FormService
- func (s *FormService) AddOptions(data url.Values) *FormService
- func (s *FormService) SetHsContext(context HsContext) *FormService
- func (s *FormService) SetHubspotCookie(cookie string) *FormService
- func (s *FormService) SetPageName(name string) *FormService
- func (s *FormService) SetPageUrl(url string) *FormService
- func (s *FormService) SetRemoteIpAddress(url string) *FormService
- func (s *FormService) SetReturnUrl(url string) *FormService
- func (s *FormService) SubmitForm(portalID int, formID string) error
- type FormSubmissionFilterItem
- type FormSubmissionOperator
- type HsContext
- type HubspotClient
- func (c *HubspotClient) Do(req *http.Request, v interface{}) error
- func (c *HubspotClient) Get(url string) (*http.Request, error)
- func (c *HubspotClient) NewRequest(method, urlStr string, body interface{}) (*http.Request, error)
- func (c *HubspotClient) Post(url string, body interface{}) (*http.Request, error)
- func (c *HubspotClient) RunDelete(url string, res interface{}) error
- func (c *HubspotClient) RunGet(url string, res interface{}) error
- func (c *HubspotClient) RunPost(url string, body, res interface{}) error
- func (c *HubspotClient) RunPut(url string, body, res interface{}) error
- type IdentityProfile
- type ItemDataType
- type ItemFieldType
- type ItemProperties
- type ItemProperty
- type ItemPropertyGroup
- type ItemPropertyGroups
- type ItemPropertyOption
- type ListMembershipFilterItem
- type ListMembershipOperator
- type Metadata
- type OAuth2
- type Page
- type PageViewFilterItem
- type PageviewsOperator
- type ProcessingType
- type Properties
- type Property
- type UnixTime
- type Version
- type Versions
- type Vid
Constants ¶
const ( // Contact Operators: IsNotEmpty ContactOperator = "IS_NOT_EMPTY" IsEmpty ContactOperator = "IS_EMPTY" Eq ContactOperator = "EQ" NotEq ContactOperator = "NEQ" Conatains ContactOperator = "CONTAINS" Lt ContactOperator = "LT" Lte ContactOperator = "LTE" Gt ContactOperator = "GT" SetAny ContactOperator = "SET_ANY" SetNotAny ContactOperator = "SET_NOT_ANY" SetEq ContactOperator = "SET_EQ" SetNotEq ContactOperator = "SET_NEQ" SetAll ContactOperator = "SET_ALL" // ComputedProperty DateOfLastFormSubmission ComputedProperty = "DATE_OF_LAST_FORM_SUBMISSION" NumberOfFormsFilledOut ComputedProperty = "NUMBER_OF_FORMS_FILLED_OUT" // ListMembership operator InList ListMembershipOperator = "IN_LIST" NotInList ListMembershipOperator = "NOT_IN_LIST" // Form Submission HasFilledOutForm FormSubmissionOperator = "HAS_FILLED_OUT_FORM" HasNotFilledOutForm FormSubmissionOperator = "HAS_NOT_FILLED_OUT_FORM" // Events HasEvent EventsOpeerator = "HAS_EVENT" NotHasEvent EventsOpeerator = "NOT_HAS_EVENT" PageviewEq PageviewsOperator = "HAS_PAGEVIEW_EQ" PageviewContains PageviewsOperator = "HAS_PAGEVIEW_CONTAINS" PageviewMatchesRegexp PageviewsOperator = "HAS_PAGEVIEW_MATCHES_REGEX" PageviewNotEq PageviewsOperator = "NOT_HAS_PAGEVIEW_EQ" PageviewNotContains PageviewsOperator = "NOT_HAS_PAGEVIEW_CONTAINS" PageviewNotMatchRegexpt PageviewsOperator = "NOT_HAS_PAGEVIEW_MATCHES_REGEX" )
Variables ¶
This section is empty.
Functions ¶
func CheckResponse ¶
func DumpRequest ¶
DumpRequest shows the request at console
func NewContactListOptions ¶
func NewContactListOptions(listCount, offset int) *contactListsOptions
Types ¶
type APIKeyAuth ¶
type APIKeyAuth struct {
// contains filtered or unexported fields
}
func NewAPIKeyAuth ¶
func NewAPIKeyAuth(apikey string) APIKeyAuth
NewAPIKeyAuth create new API KEY Authenticator
func (APIKeyAuth) Authenticate ¶
func (auth APIKeyAuth) Authenticate(request *http.Request) error
Authenticate set auth
type Authenticator ¶
Authenticator interface for auth
type CompaniesService ¶
type CompaniesService service
type Company ¶
type Company struct { PortalId int `json:"portalId"` CompanyId int `json:"companyId"` IsDeleted bool `json:"isDeleted"` Properties CompanyProperties `json:"properties"` }
type CompanyProperties ¶
type CompanyProperties struct { }
type CompanyPropertiesService ¶
type CompanyPropertiesService service
CompanyPropertiesService Company Properties Service definition
func (*CompanyPropertiesService) Create ¶
func (s *CompanyPropertiesService) Create(property ItemProperty) (*ItemProperty, error)
Create create a contact property
func (*CompanyPropertiesService) CreateGroup ¶
func (s *CompanyPropertiesService) CreateGroup(group ItemPropertyGroup) (*ItemPropertyGroup, error)
CreateGroup creates a contact property group
func (*CompanyPropertiesService) Delete ¶
func (s *CompanyPropertiesService) Delete(name string) error
Delete deletes a contact property by name
func (*CompanyPropertiesService) DeleteGroup ¶
func (s *CompanyPropertiesService) DeleteGroup(name string) error
DeleteGroup deletes a contact property group
func (*CompanyPropertiesService) GetAll ¶
func (s *CompanyPropertiesService) GetAll() (*ItemProperties, error)
GetAll gets all company properties
func (*CompanyPropertiesService) GetByName ¶
func (s *CompanyPropertiesService) GetByName(name string) (*ItemProperty, error)
GetByName gets company property by name
func (*CompanyPropertiesService) GetGroups ¶
func (s *CompanyPropertiesService) GetGroups() (*ItemPropertyGroups, error)
GetGroups gets all contacts property groups
func (*CompanyPropertiesService) Update ¶
func (s *CompanyPropertiesService) Update(name string, update ItemProperty) (*ItemProperty, error)
Update updates an existing property by it name
func (*CompanyPropertiesService) UpdateGroup ¶
func (s *CompanyPropertiesService) UpdateGroup(name string, update ItemPropertyGroup) (*ItemPropertyGroup, error)
UpdateGroup updates contact property group
type ComputedProperty ¶
type ComputedProperty string
type Contact ¶
type Contact struct { Vid int `json:"vid"` CanonicalVid int `json:"canonical-vid"` MergedVids []int `json:"merged-vids"` PortalID int `json:"portal-id"` IsContact bool `json:"is-contact"` ProfileToken string `json:"profile-token"` ProfileURL string `json:"profile-url"` Properties map[string]Property `json:"properties"` }
type ContactDeleteResult ¶
type ContactFilterItem ¶
type ContactFilterItem struct { Operator ContactOperator `json:"operator"` Property string `json:"property"` ComputedProperty ComputedProperty `json:"computed_property"` Value interface{} `json:"value"` Type string `json:"type"` }
type ContactList ¶
type ContactList struct { ParentID int `json:"parentId"` // Integer, read-only; The ID of the folder that the list belongs to. Currently folders can only be managed in the HubSpot app Dynamic bool `json:"dynamic"` Name string `json:"name"` Filters Filters `json:"filters"` PortalID int `json:"portalId"` CreatedAt UnixTime `json:"createdAt"` ListID int `json:"listId"` UpdatedAt UnixTime `json:"updatedAt"` InternalListID int `json:"internalListId"` Deleteable bool `json:"deleteable"` Metadata Metadata `json:"metaData"` }
type ContactLists ¶
type ContactLists struct { Lists []ContactList `json:"lists"` Page }
type ContactListsService ¶
type ContactListsService service
func (*ContactListsService) CreateContactList ¶
func (s *ContactListsService) CreateContactList(name string) (*ContactList, error)
func (*ContactListsService) GetContactList ¶
func (s *ContactListsService) GetContactList(listId int) (*ContactList, error)
func (*ContactListsService) GetContactLists ¶
func (s *ContactListsService) GetContactLists() (*ContactLists, error)
type ContactOperator ¶
type ContactOperator FilterOperator
type ContactPropertiesService ¶
type ContactPropertiesService service
ContactPropertiesService - Contact properties are used to store specific information for each of your contact records
func (*ContactPropertiesService) Create ¶
func (s *ContactPropertiesService) Create(property ItemProperty) (*ItemProperty, error)
Create create a contact property
func (*ContactPropertiesService) CreateGroup ¶
func (s *ContactPropertiesService) CreateGroup(group ItemPropertyGroup) (*ItemPropertyGroup, error)
CreateGroup creates a contact property group
func (*ContactPropertiesService) Delete ¶
func (s *ContactPropertiesService) Delete(name string) error
Delete deletes a contact property by name
func (*ContactPropertiesService) DeleteGroup ¶
func (s *ContactPropertiesService) DeleteGroup(name string) error
DeleteGroup deletes a contact property group
func (*ContactPropertiesService) GetAll ¶
func (s *ContactPropertiesService) GetAll() (*ItemProperties, error)
GetAll gets all contacts properties
func (*ContactPropertiesService) GetByName ¶
func (s *ContactPropertiesService) GetByName(name string) (*ItemProperty, error)
GetByName gets property by name
func (*ContactPropertiesService) GetGroups ¶
func (s *ContactPropertiesService) GetGroups() (*ItemPropertyGroups, error)
GetGroups gets all contacts property groups
func (*ContactPropertiesService) Update ¶
func (s *ContactPropertiesService) Update(name string, update ItemProperty) (*ItemProperty, error)
Update updates an existing property by it name
func (*ContactPropertiesService) UpdateGroup ¶
func (s *ContactPropertiesService) UpdateGroup(name string, update ItemPropertyGroup) (*ItemPropertyGroup, error)
UpdateGroup updates contact property group
type ContactsService ¶
type ContactsService service
func (*ContactsService) Create ¶
func (s *ContactsService) Create(properties Properties) (*IdentityProfile, error)
func (*ContactsService) CreateOrUpdateByEmail ¶
func (s *ContactsService) CreateOrUpdateByEmail(email string, properties Properties) (*Vid, error)
func (*ContactsService) DeleteById ¶
func (s *ContactsService) DeleteById(id int) (*ContactDeleteResult, error)
func (*ContactsService) GetById ¶
func (s *ContactsService) GetById(contactID int) (*Contact, error)
func (*ContactsService) GetByToken ¶
func (s *ContactsService) GetByToken(token string) (*Contact, error)
func (*ContactsService) Merge ¶
func (s *ContactsService) Merge(primaryID, secondaryID int) error
func (*ContactsService) Update ¶
func (s *ContactsService) Update(contactID int, properties Properties) error
func (*ContactsService) UpdateByEmail ¶
func (s *ContactsService) UpdateByEmail(email string, properties Properties) error
type EventsFilterItem ¶
type EventsFilterItem struct { Operator EventsOpeerator `json:"operator"` EventID int `json:"value"` FirstOccurenceAfter UnixTime `json:"firstOccurrenceAfterTimestamp"` FirstOccurenceBefore UnixTime `json:"firstOccurrenceBeforeTimestamp"` LastOccurenceAfter UnixTime `json:"lastOccurrenceAfterTimestamp"` LastOccurenceBefore UnixTime `json:"lastOccurrenceBeforeTimestamp"` MinOccurence int `json:"minOccurrences"` MaxOccurence int `json:"maxOccurrences"` }
type EventsOpeerator ¶
type EventsOpeerator FilterOperator
type FilterItem ¶
type FilterItem struct {
Operator FilterOperator
}
type FilterOperator ¶
type FilterOperator string
type FormService ¶
type FormService struct {
// contains filtered or unexported fields
}
FormService The Forms API's principle method is the submit form method, which allows you to pass any information captured on your website or application to HubSpot, including any custom data. This endpoint doesn't require authentication, so you can make the call from a form to our API from the client without needing to worry about insecurity.
func (*FormService) AddOption ¶
func (s *FormService) AddOption(key, value string) *FormService
func (*FormService) AddOptions ¶
func (s *FormService) AddOptions(data url.Values) *FormService
func (*FormService) SetHsContext ¶
func (s *FormService) SetHsContext(context HsContext) *FormService
func (*FormService) SetHubspotCookie ¶
func (s *FormService) SetHubspotCookie(cookie string) *FormService
func (*FormService) SetPageName ¶
func (s *FormService) SetPageName(name string) *FormService
func (*FormService) SetPageUrl ¶
func (s *FormService) SetPageUrl(url string) *FormService
func (*FormService) SetRemoteIpAddress ¶
func (s *FormService) SetRemoteIpAddress(url string) *FormService
func (*FormService) SetReturnUrl ¶
func (s *FormService) SetReturnUrl(url string) *FormService
func (*FormService) SubmitForm ¶
func (s *FormService) SubmitForm(portalID int, formID string) error
type FormSubmissionFilterItem ¶
type FormSubmissionFilterItem struct { Operator FormSubmissionOperator `json:"operator"` FormID int `json:"form"` PageID int `json:"page"` AfterTimestamp UnixTime `json:"afterTimestamp"` Beforetimestamp UnixTime `json:"beforeTimestamp"` }
type FormSubmissionOperator ¶
type FormSubmissionOperator FilterOperator
type HubspotClient ¶
type HubspotClient struct { BaseURL *url.URL UserAgent string // Services used for talking to different parts of the API ContactLists *ContactListsService Contacts *ContactsService ContactProperties *ContactPropertiesService CompanyProperties *CompanyPropertiesService Companies *CompaniesService Forms *FormService // contains filtered or unexported fields }
func NewHubspotApiClient ¶
func NewHubspotApiClient(apikey string) *HubspotClient
func NewHubspotClient ¶
func NewHubspotClient(auth Authenticator) *HubspotClient
func NewHubspotOAuthClient ¶
func NewHubspotOAuthClient(token string) *HubspotClient
func (*HubspotClient) Do ¶
func (c *HubspotClient) Do(req *http.Request, v interface{}) error
Do sends an API request and returns the API response
func (*HubspotClient) Get ¶
func (c *HubspotClient) Get(url string) (*http.Request, error)
Get creates a new GET API request
func (*HubspotClient) NewRequest ¶
func (c *HubspotClient) NewRequest(method, urlStr string, body interface{}) (*http.Request, error)
NewRequest creates a new API request.
func (*HubspotClient) Post ¶
func (c *HubspotClient) Post(url string, body interface{}) (*http.Request, error)
Post creates a new POST request
func (*HubspotClient) RunDelete ¶
func (c *HubspotClient) RunDelete(url string, res interface{}) error
func (*HubspotClient) RunGet ¶
func (c *HubspotClient) RunGet(url string, res interface{}) error
func (*HubspotClient) RunPost ¶
func (c *HubspotClient) RunPost(url string, body, res interface{}) error
func (*HubspotClient) RunPut ¶
func (c *HubspotClient) RunPut(url string, body, res interface{}) error
type IdentityProfile ¶
type IdentityProfile struct { }
type ItemDataType ¶
type ItemDataType string
const ( String ItemDataType = "string" Number ItemDataType = "number" Date ItemDataType = "date" DateTime ItemDataType = "datetime" Enumeration ItemDataType = "enumeration" )
type ItemFieldType ¶
type ItemFieldType string
const ( TextAreaField ItemFieldType = "textarea" TextField ItemFieldType = "text" DateField ItemFieldType = "date" FileField ItemFieldType = "file" NumberField ItemFieldType = "number" SelectField ItemFieldType = "select" RadioField ItemFieldType = "radio" CheckboxField ItemFieldType = "checkbox" BooleanCheckboxField ItemFieldType = "booleancheckbox" )
type ItemProperty ¶
type ItemProperty struct { Name string `json:"name"` Label string `json:"label,omitempty"` Description string `json:"description,omitempty"` DataType ItemDataType `json:"type,omitempty"` FieldType ItemFieldType `json:"fieldType,omitempty"` GroupName string `json:"groupName,omitempty"` Options []ItemPropertyOption `json:"options"` Deleted bool `json:"deleted"` FormField bool `json:"formField"` DisplayOrder int `json:"displayOrder"` ReadOnlyValue bool `json:"readOnlyValue"` ReadOnlyDefinition bool `json:"readOnlyDefinition"` Hidden bool `json:"hidden"` MutableDefinitionNotDeletable bool `json:"mutableDefinitionNotDeletable"` Calculated bool `json:"calculated"` ExternalOptions bool `json:"externalOptions"` }
ItemProperty definition
type ItemPropertyGroup ¶
type ItemPropertyGroup struct { Name string `json:"name"` DisplayName string `json:"displayName"` DisplayOrder int `json:"displayOrder"` HubspotDefined bool `json:"hubspotDefined"` }
ItemPropertyGroup item property group definition
type ItemPropertyGroups ¶
type ItemPropertyGroups []ItemPropertyGroup
ItemPropertyGroups ItemPropertyGroup list type
type ItemPropertyOption ¶
type ItemPropertyOption struct { Description string `json:"description"` Label string `json:"label"` DisplayOrder int `json:"displayOrder"` Hidden bool `json:"hidden"` Value interface{} `json:"value"` }
ItemPropertyOption definition
type ListMembershipFilterItem ¶
type ListMembershipFilterItem struct { Operator ListMembershipOperator `json:"operator"` ListID int `json:"list"` }
type ListMembershipOperator ¶
type ListMembershipOperator FilterOperator
type Metadata ¶
type Metadata struct { Processing ProcessingType `json:"processing"` Size int `json:"size"` Error string `json:"error"` LastProcessingStateChangeAt UnixTime `json:"lastProcessingStateChangeAt"` LastSizeChangeAt UnixTime `json:"lastSizeChangeAt"` }
type OAuth2 ¶
type OAuth2 struct {
// contains filtered or unexported fields
}
OAuth2 OAuth 2 hubspot authenticator
type PageViewFilterItem ¶
type PageViewFilterItem struct { Operator PageviewsOperator `json:"operator"` Value string `json:"value"` FirstOccurenceAfter UnixTime `json:"firstOccurrenceAfterTimestamp"` FirstOccurenceBefore UnixTime `json:"firstOccurrenceBeforeTimestamp"` LastOccurenceAfter UnixTime `json:"lastOccurrenceAfterTimestamp"` LastOccurenceBefore UnixTime `json:"lastOccurrenceBeforeTimestamp"` MinOccurence int `json:"minOccurrences"` MaxOccurence int `json:"maxOccurrences"` }
type PageviewsOperator ¶
type PageviewsOperator FilterOperator
type ProcessingType ¶
type ProcessingType string
const ( DONE ProcessingType = "DONE" REFRESHING ProcessingType = "REFRESHING" INITIALIZING ProcessingType = "INITIALIZING" PROCESSING ProcessingType = "PROCESSING" )
type Properties ¶
type Properties struct {
Properties []Property `json:"properties"`
}
func (*Properties) AddProperty ¶
func (p *Properties) AddProperty(prop string, value interface{})
AddProperty addes a new property to list