contacts

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: May 16, 2019 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package contacts are for the fundamental building block to HubSpot, contacts. They store lead-specific data that makes it possible to leverage much of the functionality in HubSpot, from marketing automation, to lead scoring to smart content.

Package contacts are for the fundamental building block to HubSpot, contacts. They store lead-specific data that makes it possible to leverage much of the functionality in HubSpot, from marketing automation, to lead scoring to smart content.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Contact

type Contact struct {
	AddedAt          int64                        `json:"addedAt"`
	Vid              int64                        `json:"vid"`
	CanonicalVid     int64                        `json:"canonical-vid"`
	MergedVids       []interface{}                `json:"merged-vids"`
	PortalID         int64                        `json:"portal-id"`
	IsContact        bool                         `json:"is-contact"`
	ProfileToken     string                       `json:"profile-token"`
	ProfileURL       string                       `json:"profile-url"`
	Properties       map[string]map[string]string `json:"properties"`
	FormSubmissions  []interface{}                `json:"form-submissions"`
	IdentityProfiles []IdentityProfile            `json:"identity-profiles"`
	MergeAudits      []interface{}                `json:"merge-audits"`
}

Contact is a single contact in HubSpot

type Contacts

type Contacts struct {
	*client.Client
	Count      int64
	OffSet     int64
	Properties []string
}

Contacts contains the elements to communicate with the HubSpot Contacts endpoints.

func New

func New(c *client.Client) *Contacts

New creates a new instance of the Contacts service with default settings. Because of the central role contacts play in the HubSpot application, it is not surprising that most integrations with HubSpot either read or write Contacts data.

func (*Contacts) GetRecentlyUpdatedContacts

func (c *Contacts) GetRecentlyUpdatedContacts() ([]Contact, error)

GetRecentlyUpdatedContacts returns, for a given account, all contacts that have been recently updated or created.

func (*Contacts) UpdateContact

func (c *Contacts) UpdateContact(contactID string, props map[string]string) error

UpdateContact is to update an existing contact in HubSpot. This method lets you update the properties of a contact in HubSpot. The map[string]string represents the new values for the contact, where the map key is the name of the property and the map value is the new value

func (*Contacts) WithCount

func (c *Contacts) WithCount(count int64) *Contacts

WithCount sets an account value returning a Contacts pointer for chaining.

func (*Contacts) WithOffSet

func (c *Contacts) WithOffSet(offset int64) *Contacts

WithOffSet sets an offset value returning a Contacts pointer for chaining.

func (*Contacts) WithProperties

func (c *Contacts) WithProperties(props []string) *Contacts

WithProperties sets the "property" parameter, then the properties in the "contact" object in the returned data will only include the property or properties that you request. returning a Contacts pointer for chaining.

type HubSpotContacts

type HubSpotContacts struct {
	Contacts   []Contact `json:"contacts"`
	HasMore    bool      `json:"has-more"`
	VidOffset  int64     `json:"vid-offset"`
	TimeOffset int64     `json:"time-offset"`
}

HubSpotContacts is the payload returned after calling the Contacts API

type Identity

type Identity struct {
	Type      string `json:"type"`
	Value     string `json:"value"`
	Timestamp int64  `json:"timestamp"`
	IsPrimary *bool  `json:"is-primary,omitempty"`
}

Identity is a struct generated from the HubSpot API

type IdentityProfile

type IdentityProfile struct {
	Vid                     int64      `json:"vid"`
	SavedAtTimestamp        int64      `json:"saved-at-timestamp"`
	DeletedChangedTimestamp int64      `json:"deleted-changed-timestamp"`
	Identities              []Identity `json:"identities"`
}

IdentityProfile is a struct generated from the HubSpot API

type Properties

type Properties struct {
	Properties []Property `json:"properties"`
}

Properties is a struct generated from the HubSpot API

func (*Properties) Marshal

func (r *Properties) Marshal() ([]byte, error)

Marshal takes an Properties struct and transforms it into a byte array

type Property

type Property struct {
	Property string `json:"property,omitempty"`
	Value    string `json:"value"`
}

Property is a struct generated from the HubSpot API

Jump to

Keyboard shortcuts

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