Documentation ¶
Index ¶
- Constants
- type Contact
- type ContactList
- type Intercom
- func (ic *Intercom) ArchiveContact(contact Contact) (contact1 Contact, err error)
- func (ic *Intercom) ArchiveUser(user User) (user1 User, err error)
- func (ic *Intercom) CreateUserEvent(email, eventName string, metadata map[string]string) (err error)
- func (ic *Intercom) ListContacts(page int64, order, sort string) (contactList ContactList, err error)
- func (ic *Intercom) ListUsers(page int64, order, sort string) (userList UserList, err error)
- func (ic *Intercom) UpsertUser(email, name, typ string) (err error)
- type PageParams
- type User
- type UserList
- type UserListRequestParams
Constants ¶
const ( API_USERS = "https://api.intercom.io/users" API_EVENTS = "https://api.intercom.io/events" API_CONTACTS = "https://api.intercom.io/contacts" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Contact ¶
type Contact struct { ID string `json:"id,omitempty"` Email string `json:"email,omitempty"` Phone string `json:"phone,omitempty"` UserID string `json:"user_id,omitempty"` Name string `json:"name,omitempty"` //Avatar *UserAvatar `json:"avatar,omitempty"` //LocationData *LocationData `json:"location_data,omitempty"` LastRequestAt int64 `json:"last_request_at,omitempty"` CreatedAt int64 `json:"created_at,omitempty"` UpdatedAt int64 `json:"updated_at,omitempty"` SessionCount int64 `json:"session_count,omitempty"` LastSeenIP string `json:"last_seen_ip,omitempty"` //SocialProfiles *SocialProfileList `json:"social_profiles,omitempty"` UnsubscribedFromEmails *bool `json:"unsubscribed_from_emails,omitempty"` UserAgentData string `json:"user_agent_data,omitempty"` //Tags *TagList `json:"tags,omitempty"` //Segments *SegmentList `json:"segments,omitempty"` //Companies *CompanyList `json:"companies,omitempty"` CustomAttributes map[string]interface{} `json:"custom_attributes,omitempty"` UpdateLastRequestAt *bool `json:"update_last_request_at,omitempty"` NewSession *bool `json:"new_session,omitempty"` }
Contact represents a Contact within Intercom. Not all of the fields are writeable to the API, non-writeable fields are stripped out from the request. Please see the API documentation for details.
type ContactList ¶
type ContactList struct { Pages PageParams Contacts []Contact ScrollParam string `json:"scroll_param,omitempty"` }
ContactList holds a list of Contacts and paging information
type Intercom ¶
type Intercom struct {
AccountKey string // account key
}
func NewIntercom ¶
func (*Intercom) ArchiveContact ¶
Archives contact.
func (*Intercom) ArchiveUser ¶
Archives user.
func (*Intercom) CreateUserEvent ¶
func (ic *Intercom) CreateUserEvent(email, eventName string, metadata map[string]string) (err error)
Adds an event to a user.
func (*Intercom) ListContacts ¶
func (ic *Intercom) ListContacts(page int64, order, sort string) (contactList ContactList, err error)
Lists contacts: page - page number order - "asc", "desc" sort - which field to sort by:
created_at, last_request_at, signed_up_at, updated_at
func (*Intercom) ListUsers ¶
Lists users: page - page number order - "asc", "desc" sort - which field to sort by:
created_at, last_request_at, signed_up_at, updated_at
func (*Intercom) UpsertUser ¶
Creates or updates a user.
type PageParams ¶
type PageParams struct { Page int64 `json:"page" url:"page,omitempty"` PerPage int64 `json:"per_page" url:"per_page,omitempty"` TotalPages int64 `json:"total_pages" url:"-"` }
PageParams determine paging information to and from the API
type User ¶
type User struct { ID string `json:"id,omitempty"` Email string `json:"email,omitempty"` Phone string `json:"phone,omitempty"` UserID string `json:"user_id,omitempty"` Anonymous *bool `json:"anonymous,omitempty"` Name string `json:"name,omitempty"` Pseudonym string `json:"pseudonym,omitempty"` //Avatar *UserAvatar `json:"avatar,omitempty"` //LocationData *LocationData `json:"location_data,omitempty"` SignedUpAt int64 `json:"signed_up_at,omitempty"` RemoteCreatedAt int64 `json:"remote_created_at,omitempty"` LastRequestAt int64 `json:"last_request_at,omitempty"` CreatedAt int64 `json:"created_at,omitempty"` UpdatedAt int64 `json:"updated_at,omitempty"` SessionCount int64 `json:"session_count,omitempty"` LastSeenIP string `json:"last_seen_ip,omitempty"` //SocialProfiles *SocialProfileList `json:"social_profiles,omitempty"` UnsubscribedFromEmails *bool `json:"unsubscribed_from_emails,omitempty"` UserAgentData string `json:"user_agent_data,omitempty"` //Tags *TagList `json:"tags,omitempty"` //Segments *SegmentList `json:"segments,omitempty"` //Companies *CompanyList `json:"companies,omitempty"` CustomAttributes map[string]interface{} `json:"custom_attributes,omitempty"` UpdateLastRequestAt *bool `json:"update_last_request_at,omitempty"` NewSession *bool `json:"new_session,omitempty"` LastSeenUserAgent string `json:"last_seen_user_agent,omitempty"` }
User represents a User within Intercom. Not all of the fields are writeable to the API, non-writeable fields are stripped out from the request. Please see the API documentation for details.
type UserList ¶
type UserList struct { Pages PageParams Users []User ScrollParam string `json:"scroll_param,omitempty"` }
UserList holds a list of Users and paging information
type UserListRequestParams ¶
type UserListRequestParams struct { Page int64 `json:"page" url:"page,omitempty"` PerPage int64 `json:"per_page" url:"per_page,omitempty"` TotalPages int64 `json:"total_pages" url:"-"` Order string `json:"order" url:"order,omitempty"` Sort string `json:"sort" url:"sort,omitempty"` CreatedSince string `json:"created_since" url:"created_since,omitempty"` }
Request parameters: user list