Documentation
¶
Overview ¶
Package intercom provides an idiomatic Go client for the Intercom API.
Create a client with an Intercom access token:
client, err := intercom.NewClient("access-token")
Or read the token from INTERCOM_ACCESS_TOKEN:
client, err := intercom.NewClientFromEnv()
The client exposes service fields for Intercom resources, for example:
admin, err := client.Admins.Me(ctx) contact, err := client.Contacts.Get(ctx, "contact_id") conversations, err := client.Conversations.List(ctx)
Index ¶
- Constants
- Variables
- func FinAgentWebhookSignature(secret string, payload []byte) string
- func VerifyFinAgentWebhookSignature(secret string, payload []byte, signature string) error
- func VerifyWebhookSignature(clientSecret string, payload []byte, header http.Header) error
- func WebhookSignature(clientSecret string, payload []byte) string
- type AIContentService
- func (s *AIContentService) CreateContentImportSource(ctx context.Context, req ContentImportSourceCreate) (*ContentImportSource, error)
- func (s *AIContentService) CreateExternalPage(ctx context.Context, req ExternalPageCreate) (*ExternalPage, error)
- func (s *AIContentService) DeleteContentImportSource(ctx context.Context, sourceID string) error
- func (s *AIContentService) DeleteExternalPage(ctx context.Context, pageID string) (*ExternalPage, error)
- func (s *AIContentService) GetContentImportSource(ctx context.Context, sourceID string) (*ContentImportSource, error)
- func (s *AIContentService) GetExternalPage(ctx context.Context, pageID string) (*ExternalPage, error)
- func (s *AIContentService) ListContentImportSources(ctx context.Context) (*ContentImportSourceList, error)
- func (s *AIContentService) ListExternalPages(ctx context.Context) (*ExternalPageList, error)
- func (s *AIContentService) UpdateContentImportSource(ctx context.Context, sourceID string, req ContentImportSourceUpdate) (*ContentImportSource, error)
- func (s *AIContentService) UpdateExternalPage(ctx context.Context, pageID string, req ExternalPageUpdate) (*ExternalPage, error)
- type Admin
- type AdminActivityLogs
- type AdminDetail
- type AdminList
- type AdminSetAway
- type AdminsService
- func (s *AdminsService) List(ctx context.Context) (*AdminList, error)
- func (s *AdminsService) ListActivityLogs(ctx context.Context, createdAtAfter string) (*AdminActivityLogs, error)
- func (s *AdminsService) Me(ctx context.Context) (*Admin, error)
- func (s *AdminsService) Retrieve(ctx context.Context, adminID string) (*AdminDetail, error)
- func (s *AdminsService) SetAway(ctx context.Context, adminID string, req AdminSetAway) (*AdminDetail, error)
- type Article
- type ArticleCreate
- type ArticleDeleted
- type ArticleList
- type ArticleSearch
- type ArticleSearchResult
- type ArticleUpdate
- type ArticlesService
- func (s *ArticlesService) Create(ctx context.Context, article ArticleCreate) (*Article, error)
- func (s *ArticlesService) Delete(ctx context.Context, articleID string) (*ArticleDeleted, error)
- func (s *ArticlesService) List(ctx context.Context) (*ArticleList, error)
- func (s *ArticlesService) Retrieve(ctx context.Context, articleID string) (*Article, error)
- func (s *ArticlesService) Search(ctx context.Context, search ArticleSearch) (*ArticleSearchResult, error)
- func (s *ArticlesService) Update(ctx context.Context, articleID string, article ArticleUpdate) (*Article, error)
- type AwayStatusReason
- type AwayStatusReasonsService
- type Brand
- type BrandList
- type BrandsService
- type Call
- type CallList
- type CallWithTranscript
- type CallWithTranscriptList
- type CallsService
- func (s *CallsService) CollectFinVoiceCallByExternalID(ctx context.Context, externalID string) (*FinVoiceCall, error)
- func (s *CallsService) CollectFinVoiceCallByID(ctx context.Context, id int) (*FinVoiceCall, error)
- func (s *CallsService) CollectFinVoiceCallByPhoneNumber(ctx context.Context, phone string) (*FinVoiceCall, error)
- func (s *CallsService) CollectFinVoiceCallsByConversationID(ctx context.Context, conversationID string) ([]FinVoiceCall, error)
- func (s *CallsService) Get(ctx context.Context, callID string) (*Call, error)
- func (s *CallsService) GetRecording(ctx context.Context, callID string) ([]byte, error)
- func (s *CallsService) GetTranscript(ctx context.Context, callID string) ([]byte, error)
- func (s *CallsService) List(ctx context.Context) (*CallList, error)
- func (s *CallsService) ListWithOptions(ctx context.Context, options PageOptions) (*CallList, error)
- func (s *CallsService) ListWithTranscripts(ctx context.Context, conversationIDs []string) (*CallWithTranscriptList, error)
- func (s *CallsService) Recording(ctx context.Context, callID string) ([]byte, error)
- func (s *CallsService) RegisterFinVoiceCall(ctx context.Context, req RegisterFinVoiceCallRequest) (*FinVoiceCall, error)
- func (s *CallsService) Transcript(ctx context.Context, callID string) ([]byte, error)
- type Client
- type Collection
- type CollectionCreate
- type CollectionList
- type CollectionUpdate
- type CollectionsService
- func (s *CollectionsService) Create(ctx context.Context, collection CollectionCreate) (*Collection, error)
- func (s *CollectionsService) Delete(ctx context.Context, collectionID string) error
- func (s *CollectionsService) List(ctx context.Context) (*CollectionList, error)
- func (s *CollectionsService) Retrieve(ctx context.Context, collectionID string) (*Collection, error)
- func (s *CollectionsService) Update(ctx context.Context, collectionID string, collection CollectionUpdate) (*Collection, error)
- type CompaniesService
- func (s *CompaniesService) AttachContact(ctx context.Context, contactID, companyID string) (*Company, error)
- func (s *CompaniesService) CreateOrUpdate(ctx context.Context, company CompanyCreate) (*Company, error)
- func (s *CompaniesService) Delete(ctx context.Context, companyID string) (*CompanyDeleted, error)
- func (s *CompaniesService) DetachContact(ctx context.Context, contactID, companyID string) (*Company, error)
- func (s *CompaniesService) List(ctx context.Context, options CompanyListOptions) (*CompanyList, error)
- func (s *CompaniesService) ListAll(ctx context.Context) (*CompanyList, error)
- func (s *CompaniesService) ListAllWithOptions(ctx context.Context, options CompanyListAllOptions) (*CompanyList, error)
- func (s *CompaniesService) ListContacts(ctx context.Context, companyID string) (*CompanyContacts, error)
- func (s *CompaniesService) ListForContact(ctx context.Context, contactID string) (*ContactCompanies, error)
- func (s *CompaniesService) ListNotes(ctx context.Context, companyID string) (*NoteList, error)
- func (s *CompaniesService) ListSegments(ctx context.Context, companyID string) (*CompanySegmentsAttached, error)
- func (s *CompaniesService) Retrieve(ctx context.Context, companyID string) (*Company, error)
- func (s *CompaniesService) RetrieveByID(ctx context.Context, companyID string) (*CompanyList, error)
- func (s *CompaniesService) Scroll(ctx context.Context) (*CompanyScroll, error)
- func (s *CompaniesService) ScrollWithOptions(ctx context.Context, options CompanyScrollOptions) (*CompanyScroll, error)
- func (s *CompaniesService) Update(ctx context.Context, companyID string, update CompanyUpdate) (*Company, error)
- type Company
- type CompanyContacts
- type CompanyCreate
- type CompanyDeleted
- type CompanyList
- type CompanyListAllOptions
- type CompanyListOptions
- type CompanyScroll
- type CompanyScrollOptions
- type CompanySegmentsAttached
- type CompanyUpdate
- type Contact
- type ContactArchived
- type ContactBlocked
- type ContactCompanies
- type ContactCreate
- type ContactDeleted
- type ContactIterator
- type ContactList
- type ContactSearch
- type ContactSearchOperator
- type ContactSegments
- type ContactUnarchived
- type ContactUpdate
- type ContactsService
- func (s *ContactsService) Archive(ctx context.Context, contactID string) (*ContactArchived, error)
- func (s *ContactsService) AttachSubscription(ctx context.Context, contactID, subscriptionID, consentType string) (*SubscriptionType, error)
- func (s *ContactsService) AttachTag(ctx context.Context, contactID, tagID string) (*Tag, error)
- func (s *ContactsService) Block(ctx context.Context, contactID string) (*ContactBlocked, error)
- func (s *ContactsService) Create(ctx context.Context, contact ContactCreate) (*Contact, error)
- func (s *ContactsService) CreateNote(ctx context.Context, contactID string, body string, adminID string) (*Note, error)
- func (s *ContactsService) Delete(ctx context.Context, contactID string) (*ContactDeleted, error)
- func (s *ContactsService) DetachSubscription(ctx context.Context, contactID, subscriptionID string) (*SubscriptionType, error)
- func (s *ContactsService) DetachTag(ctx context.Context, contactID, tagID string) (*Tag, error)
- func (s *ContactsService) Get(ctx context.Context, contactID string) (*Contact, error)
- func (s *ContactsService) GetByExternalID(ctx context.Context, externalID string) (*Contact, error)
- func (s *ContactsService) List(ctx context.Context) (*ContactList, error)
- func (s *ContactsService) ListNotes(ctx context.Context, contactID string) (*NoteList, error)
- func (s *ContactsService) ListSegments(ctx context.Context, contactID string) (*ContactSegments, error)
- func (s *ContactsService) ListSubscriptions(ctx context.Context, contactID string) (*SubscriptionTypeList, error)
- func (s *ContactsService) ListTags(ctx context.Context, contactID string) (*TagList, error)
- func (s *ContactsService) Merge(ctx context.Context, from, into string) (*Contact, error)
- func (s *ContactsService) Search(ctx context.Context, search ContactSearch) (*ContactList, error)
- func (s *ContactsService) SearchIter(ctx context.Context, search ContactSearch) *ContactIterator
- func (s *ContactsService) Unarchive(ctx context.Context, contactID string) (*ContactUnarchived, error)
- func (s *ContactsService) Update(ctx context.Context, contactID string, contact ContactUpdate) (*Contact, error)
- type ContentImportSource
- type ContentImportSourceCreate
- type ContentImportSourceList
- type ContentImportSourceUpdate
- type Conversation
- type ConversationAdminReply
- type ConversationAssign
- type ConversationAttachContact
- type ConversationClose
- type ConversationContactReply
- type ConversationCreate
- type ConversationDeleted
- type ConversationDetachContact
- type ConversationHandlingEvent
- type ConversationHandlingEventList
- type ConversationIterator
- type ConversationList
- type ConversationListItem
- type ConversationMessage
- type ConversationOpen
- type ConversationRedactPart
- type ConversationRedactSource
- type ConversationSearchQuery
- type ConversationSnooze
- type ConversationToTicket
- type ConversationUpdate
- type ConversationsService
- func (s *ConversationsService) Assign(ctx context.Context, conversationID string, assign ConversationAssign) (*Conversation, error)
- func (s *ConversationsService) AttachContact(ctx context.Context, conversationID string, req ConversationAttachContact) (*Conversation, error)
- func (s *ConversationsService) AttachTag(ctx context.Context, conversationID, tagID, adminID string) (*Tag, error)
- func (s *ConversationsService) Close(ctx context.Context, conversationID string, req ConversationClose) (*Conversation, error)
- func (s *ConversationsService) ConvertToTicket(ctx context.Context, conversationID string, req ConversationToTicket) (*Ticket, error)
- func (s *ConversationsService) Create(ctx context.Context, conversation ConversationCreate) (*ConversationMessage, error)
- func (s *ConversationsService) Delete(ctx context.Context, conversationID string) (*ConversationDeleted, error)
- func (s *ConversationsService) DetachContact(ctx context.Context, conversationID, contactID string, ...) (*Conversation, error)
- func (s *ConversationsService) DetachTag(ctx context.Context, conversationID, tagID, adminID string) (*Tag, error)
- func (s *ConversationsService) Get(ctx context.Context, conversationID string) (*Conversation, error)
- func (s *ConversationsService) List(ctx context.Context) (*ConversationList, error)
- func (s *ConversationsService) ListHandlingEvents(ctx context.Context, conversationID string) (*ConversationHandlingEventList, error)
- func (s *ConversationsService) ListIter(ctx context.Context, options CursorPageOptions) *ConversationIterator
- func (s *ConversationsService) ListWithOptions(ctx context.Context, options CursorPageOptions) (*ConversationList, error)
- func (s *ConversationsService) Open(ctx context.Context, conversationID string, req ConversationOpen) (*Conversation, error)
- func (s *ConversationsService) RedactPart(ctx context.Context, req ConversationRedactPart) (*Conversation, error)
- func (s *ConversationsService) RedactSource(ctx context.Context, req ConversationRedactSource) (*Conversation, error)
- func (s *ConversationsService) Reply(ctx context.Context, conversationID string, reply ConversationAdminReply) (*Conversation, error)
- func (s *ConversationsService) ReplyAsContact(ctx context.Context, conversationID string, reply ConversationContactReply) (*Conversation, error)
- func (s *ConversationsService) Search(ctx context.Context, query ConversationSearchQuery) (*ConversationList, error)
- func (s *ConversationsService) SearchIter(ctx context.Context, query ConversationSearchQuery, options CursorPageOptions) *ConversationIterator
- func (s *ConversationsService) SearchWithOptions(ctx context.Context, query ConversationSearchQuery, options CursorPageOptions) (*ConversationList, error)
- func (s *ConversationsService) Snooze(ctx context.Context, conversationID string, req ConversationSnooze) (*Conversation, error)
- func (s *ConversationsService) Update(ctx context.Context, conversationID string, conversation ConversationUpdate) (*Conversation, error)
- type CursorPageOptions
- type CustomObjectInstance
- type CustomObjectInstanceCreateOrUpdate
- type CustomObjectInstanceDeleted
- type CustomObjectsService
- func (s *CustomObjectsService) CreateOrUpdate(ctx context.Context, customObjectType string, ...) (*CustomObjectInstance, error)
- func (s *CustomObjectsService) Delete(ctx context.Context, customObjectType, instanceID string) (*CustomObjectInstanceDeleted, error)
- func (s *CustomObjectsService) DeleteByExternalID(ctx context.Context, customObjectType, externalID string) (*CustomObjectInstanceDeleted, error)
- func (s *CustomObjectsService) Get(ctx context.Context, customObjectType, instanceID string) (*CustomObjectInstance, error)
- func (s *CustomObjectsService) GetByExternalID(ctx context.Context, customObjectType, externalID string) (*CustomObjectInstance, error)
- type DataAttribute
- type DataAttributeCreate
- type DataAttributeDataType
- type DataAttributeList
- type DataAttributeListParams
- type DataAttributeModel
- type DataAttributeUpdate
- type DataAttributesService
- func (s *DataAttributesService) Create(ctx context.Context, attribute DataAttributeCreate) (*DataAttribute, error)
- func (s *DataAttributesService) List(ctx context.Context, params DataAttributeListParams) (*DataAttributeList, error)
- func (s *DataAttributesService) Update(ctx context.Context, dataAttributeID string, attribute DataAttributeUpdate) (*DataAttribute, error)
- type DataEvent
- type DataEventCreate
- type DataEventListFilter
- type DataEventSummariesCreate
- type DataEventSummary
- type DataEventSummaryCreate
- type DataEventSummaryItem
- type DataEventsService
- func (s *DataEventsService) Create(ctx context.Context, event DataEventCreate) error
- func (s *DataEventsService) CreateSummaries(ctx context.Context, summaries DataEventSummariesCreate) error
- func (s *DataEventsService) List(ctx context.Context, filter DataEventListFilter) (*DataEventSummary, error)
- type DataExport
- type DataExportCreate
- type EmailList
- type EmailSetting
- type EmailsService
- type Error
- type ErrorResponse
- type ExternalPage
- type ExternalPageCreate
- type ExternalPageList
- type ExternalPageUpdate
- type FinAttachment
- type FinAttachmentType
- type FinConversationAttributeErrors
- type FinConversationErrors
- type FinConversationMetadata
- type FinConversationResponse
- type FinMessage
- type FinMessageAuthor
- type FinReply
- type FinService
- func (s *FinService) GetVoiceCallByExternalID(ctx context.Context, externalID string) (*FinVoiceCall, error)
- func (s *FinService) GetVoiceCallByID(ctx context.Context, id string) (*FinVoiceCall, error)
- func (s *FinService) GetVoiceCallByPhoneNumber(ctx context.Context, phoneNumber string) (*FinVoiceCall, error)
- func (s *FinService) ListVoiceCallsByConversation(ctx context.Context, conversationID string) ([]FinVoiceCall, error)
- func (s *FinService) RegisterVoiceCall(ctx context.Context, req RegisterFinVoiceCallRequest) (*FinVoiceCall, error)
- func (s *FinService) Reply(ctx context.Context, req FinReply) (*FinConversationResponse, error)
- func (s *FinService) StartConversation(ctx context.Context, req FinStartConversation) (*FinConversationResponse, error)
- type FinStartConversation
- type FinUser
- type FinVoiceCall
- type FinVoiceCallSource
- type HelpCenter
- type HelpCenterList
- type HelpCentersService
- type IPAllowlist
- type InternalArticle
- type InternalArticleCreate
- type InternalArticleDeleted
- type InternalArticleList
- type InternalArticleSearchResult
- type InternalArticleUpdate
- type InternalArticlesService
- func (s *InternalArticlesService) Create(ctx context.Context, article InternalArticleCreate) (*InternalArticle, error)
- func (s *InternalArticlesService) Delete(ctx context.Context, articleID string) (*InternalArticleDeleted, error)
- func (s *InternalArticlesService) List(ctx context.Context) (*InternalArticleList, error)
- func (s *InternalArticlesService) Retrieve(ctx context.Context, articleID string) (*InternalArticle, error)
- func (s *InternalArticlesService) Search(ctx context.Context, folderID *string) (*InternalArticleSearchResult, error)
- func (s *InternalArticlesService) Update(ctx context.Context, articleID string, article InternalArticleUpdate) (*InternalArticle, error)
- type Job
- type Message
- type MessageCreate
- type MessagesService
- type NewsCursorPages
- type NewsItem
- type NewsItemCreate
- type NewsItemList
- type NewsItemUpdate
- type NewsListType
- type NewsService
- func (s *NewsService) CreateItem(ctx context.Context, item NewsItemCreate) (*NewsItem, error)
- func (s *NewsService) DeleteItem(ctx context.Context, newsItemID string) error
- func (s *NewsService) ListFeedItems(ctx context.Context, newsfeedID string) (*NewsItemList, error)
- func (s *NewsService) ListFeeds(ctx context.Context) (*NewsfeedList, error)
- func (s *NewsService) ListItems(ctx context.Context) (*NewsItemList, error)
- func (s *NewsService) RetrieveFeed(ctx context.Context, newsfeedID string) (*Newsfeed, error)
- func (s *NewsService) RetrieveItem(ctx context.Context, newsItemID string) (*NewsItem, error)
- func (s *NewsService) UpdateItem(ctx context.Context, newsItemID string, item NewsItemUpdate) (*NewsItem, error)
- type Newsfeed
- type NewsfeedList
- type Note
- type NoteList
- type NotesService
- type Option
- func WithAPIVersion(version string) Option
- func WithBaseURL(baseURL string) Option
- func WithHTTPClient(httpClient *http.Client) Option
- func WithRegion(region Region) Option
- func WithResponseHook(hook ResponseHook) Option
- func WithRetry(config RetryConfig) Option
- func WithUserAgent(userAgent string) Option
- type PageInfo
- type PageOptions
- type PhoneSwitch
- type PhoneSwitchCreate
- type PhoneSwitchesService
- type Region
- type RegisterFinVoiceCallRequest
- type ReportingDataset
- type ReportingDatasetAttribute
- type ReportingDatasetList
- type ReportingExportCreate
- type ReportingExportJob
- type ResponseHook
- type ResponseInfo
- type RetryConfig
- type SearchPagination
- type Segment
- type SegmentList
- type SegmentsService
- type StartingAfterPage
- type SubscriptionType
- type SubscriptionTypeList
- type SubscriptionTypesService
- type Tag
- type TagCompanyReference
- type TagCompanyRequest
- type TagCompanyUntagReference
- type TagCompanyUntagRequest
- type TagCreateOrUpdateRequest
- type TagCreateRequest
- type TagDetail
- type TagList
- type TagUserReference
- type TagUsersRequest
- type TagsService
- func (s *TagsService) Create(ctx context.Context, req TagCreateRequest) (*TagDetail, error)
- func (s *TagsService) Delete(ctx context.Context, tagID string) error
- func (s *TagsService) List(ctx context.Context) (*TagList, error)
- func (s *TagsService) Retrieve(ctx context.Context, tagID string) (*TagDetail, error)
- type Team
- type TeamList
- type TeamsService
- type Ticket
- type TicketAdminReply
- type TicketContact
- type TicketContactEmail
- type TicketContactExternalID
- type TicketContactID
- type TicketContactReply
- type TicketCreate
- type TicketEnqueued
- type TicketIterator
- type TicketList
- type TicketReply
- type TicketReplyContact
- type TicketReplyMessageType
- type TicketReplyOption
- type TicketReplyRequest
- type TicketSearchQuery
- type TicketState
- type TicketStateList
- type TicketTagAttachRequest
- type TicketTagDetachRequest
- type TicketType
- type TicketTypeAttribute
- type TicketTypeAttributeCreate
- type TicketTypeAttributeUpdate
- type TicketTypeCreate
- type TicketTypeList
- type TicketTypeUpdate
- type TicketUpdate
- type TicketsService
- func (s *TicketsService) AttachTag(ctx context.Context, ticketID string, req TicketTagAttachRequest) (*Tag, error)
- func (s *TicketsService) Create(ctx context.Context, ticket TicketCreate) (*Ticket, error)
- func (s *TicketsService) CreateType(ctx context.Context, ticketType TicketTypeCreate) (*TicketType, error)
- func (s *TicketsService) CreateTypeAttribute(ctx context.Context, ticketTypeID string, attribute TicketTypeAttributeCreate) (*TicketTypeAttribute, error)
- func (s *TicketsService) Delete(ctx context.Context, ticketID string) error
- func (s *TicketsService) DetachTag(ctx context.Context, ticketID, tagID string, req TicketTagDetachRequest) (*Tag, error)
- func (s *TicketsService) EnqueueCreate(ctx context.Context, ticket TicketCreate) (*TicketEnqueued, error)
- func (s *TicketsService) Get(ctx context.Context, ticketID string) (*Ticket, error)
- func (s *TicketsService) GetType(ctx context.Context, ticketTypeID string) (*TicketType, error)
- func (s *TicketsService) ListStates(ctx context.Context) (*TicketStateList, error)
- func (s *TicketsService) ListTypes(ctx context.Context) (*TicketTypeList, error)
- func (s *TicketsService) Reply(ctx context.Context, ticketID string, req TicketReplyRequest, ...) (*TicketReply, error)
- func (s *TicketsService) Search(ctx context.Context, query TicketSearchQuery) (*TicketList, error)
- func (s *TicketsService) SearchIter(ctx context.Context, query TicketSearchQuery, options CursorPageOptions) *TicketIterator
- func (s *TicketsService) SearchWithOptions(ctx context.Context, query TicketSearchQuery, options CursorPageOptions) (*TicketList, error)
- func (s *TicketsService) Update(ctx context.Context, ticketID string, ticket TicketUpdate) (*Ticket, error)
- func (s *TicketsService) UpdateType(ctx context.Context, ticketTypeID string, ticketType TicketTypeUpdate) (*TicketType, error)
- func (s *TicketsService) UpdateTypeAttribute(ctx context.Context, ticketTypeID, attributeID string, ...) (*TicketTypeAttribute, error)
- type Visitor
- type VisitorConvert
- type VisitorConvertContact
- type VisitorConvertSource
- type VisitorConverted
- type VisitorUpdate
- type VisitorsService
- type WebhookEvent
- type WebhookEventData
- type WorkflowExport
- type WorkspaceService
- func (s *WorkspaceService) CancelDataExport(ctx context.Context, jobIdentifier string) (*DataExport, error)
- func (s *WorkspaceService) CreateDataExport(ctx context.Context, req DataExportCreate) (*DataExport, error)
- func (s *WorkspaceService) CreateReportingExport(ctx context.Context, req ReportingExportCreate) (*ReportingExportJob, error)
- func (s *WorkspaceService) DownloadDataExport(ctx context.Context, jobIdentifier string) ([]byte, error)
- func (s *WorkspaceService) DownloadReportingExport(ctx context.Context, jobIdentifier, appID string) ([]byte, error)
- func (s *WorkspaceService) ExportWorkflow(ctx context.Context, workflowID string) (*WorkflowExport, error)
- func (s *WorkspaceService) GetDataExport(ctx context.Context, jobIdentifier string) (*DataExport, error)
- func (s *WorkspaceService) GetIPAllowlist(ctx context.Context) (*IPAllowlist, error)
- func (s *WorkspaceService) GetReportingExportJob(ctx context.Context, jobIdentifier, appID, clientID string) (*ReportingExportJob, error)
- func (s *WorkspaceService) JobStatus(ctx context.Context, jobID string) (*Job, error)
- func (s *WorkspaceService) ListReportingDatasets(ctx context.Context) (*ReportingDatasetList, error)
- func (s *WorkspaceService) UpdateIPAllowlist(ctx context.Context, allowlist IPAllowlist) (*IPAllowlist, error)
Constants ¶
const ( // WebhookSignatureHeader is the documented Intercom webhook signature header. WebhookSignatureHeader = "X-Hub-Signature" // FinAgentWebhookSignatureHeader is the documented Fin Agent API webhook signature header. FinAgentWebhookSignatureHeader = "X-Fin-Agent-API-Webhook-Signature" )
const (
// DefaultAccessTokenEnv is the environment variable read by NewClientFromEnv.
DefaultAccessTokenEnv = "INTERCOM_ACCESS_TOKEN"
)
Variables ¶
var ( // ErrWebhookSignatureSecretRequired is returned when signature verification is attempted without a secret. ErrWebhookSignatureSecretRequired = errors.New("intercom: webhook signature secret is required") // ErrWebhookSignatureMissing is returned when the expected webhook signature header is absent. ErrWebhookSignatureMissing = errors.New("intercom: webhook signature is missing") // ErrWebhookSignatureInvalid is returned when the webhook signature does not match the payload. ErrWebhookSignatureInvalid = errors.New("intercom: webhook signature is invalid") // ErrWebhookSignatureUnsupported is returned when the signature uses an unsupported scheme. ErrWebhookSignatureUnsupported = errors.New("intercom: webhook signature scheme is unsupported") )
Functions ¶
func FinAgentWebhookSignature ¶ added in v0.1.2
FinAgentWebhookSignature returns the Fin Agent API signature header value for payload.
This is primarily useful in tests and local fixtures.
func VerifyFinAgentWebhookSignature ¶ added in v0.1.2
VerifyFinAgentWebhookSignature verifies a Fin Agent API webhook signature header value.
func VerifyWebhookSignature ¶ added in v0.1.2
VerifyWebhookSignature verifies the documented Intercom webhook signature.
Intercom signs webhook notifications with X-Hub-Signature using a "sha1=<hex>" HMAC-SHA1 over the raw request body and the app client secret.
func WebhookSignature ¶ added in v0.1.2
WebhookSignature returns the Intercom webhook signature header value for payload.
This is primarily useful in tests and local fixtures.
Types ¶
type AIContentService ¶
type AIContentService struct {
// contains filtered or unexported fields
}
AIContentService exposes AI content import source and external page Intercom API operations.
func (*AIContentService) CreateContentImportSource ¶
func (s *AIContentService) CreateContentImportSource(ctx context.Context, req ContentImportSourceCreate) (*ContentImportSource, error)
CreateContentImportSource creates a new content import source.
func (*AIContentService) CreateExternalPage ¶
func (s *AIContentService) CreateExternalPage(ctx context.Context, req ExternalPageCreate) (*ExternalPage, error)
CreateExternalPage creates a new external page.
func (*AIContentService) DeleteContentImportSource ¶
func (s *AIContentService) DeleteContentImportSource(ctx context.Context, sourceID string) error
DeleteContentImportSource deletes a content import source.
func (*AIContentService) DeleteExternalPage ¶
func (s *AIContentService) DeleteExternalPage(ctx context.Context, pageID string) (*ExternalPage, error)
DeleteExternalPage deletes an external page.
func (*AIContentService) GetContentImportSource ¶
func (s *AIContentService) GetContentImportSource(ctx context.Context, sourceID string) (*ContentImportSource, error)
GetContentImportSource retrieves a content import source by ID.
func (*AIContentService) GetExternalPage ¶
func (s *AIContentService) GetExternalPage(ctx context.Context, pageID string) (*ExternalPage, error)
GetExternalPage retrieves an external page by ID.
func (*AIContentService) ListContentImportSources ¶
func (s *AIContentService) ListContentImportSources(ctx context.Context) (*ContentImportSourceList, error)
ListContentImportSources returns all content import sources.
func (*AIContentService) ListExternalPages ¶
func (s *AIContentService) ListExternalPages(ctx context.Context) (*ExternalPageList, error)
ListExternalPages returns all external pages.
func (*AIContentService) UpdateContentImportSource ¶
func (s *AIContentService) UpdateContentImportSource(ctx context.Context, sourceID string, req ContentImportSourceUpdate) (*ContentImportSource, error)
UpdateContentImportSource updates a content import source.
func (*AIContentService) UpdateExternalPage ¶
func (s *AIContentService) UpdateExternalPage(ctx context.Context, pageID string, req ExternalPageUpdate) (*ExternalPage, error)
UpdateExternalPage updates an external page.
type Admin ¶
type Admin = gen.AdminWithAppSchema
Admin is the authenticated Intercom teammate account and workspace details.
type AdminActivityLogs ¶
type AdminActivityLogs = gen.ActivityLogListSchema
AdminActivityLogs is a page of admin activity log entries.
type AdminDetail ¶
type AdminDetail = gen.AdminSchema
AdminDetail is a single Intercom admin (without workspace details).
type AdminSetAway ¶
type AdminSetAway = gen.SetAwayAdminJSONRequestBody
AdminSetAway holds the fields for setting an admin's away status.
type AdminsService ¶
type AdminsService struct {
// contains filtered or unexported fields
}
AdminsService exposes admin-related Intercom API operations.
func (*AdminsService) List ¶
func (s *AdminsService) List(ctx context.Context) (*AdminList, error)
List returns all admins for the workspace.
func (*AdminsService) ListActivityLogs ¶
func (s *AdminsService) ListActivityLogs(ctx context.Context, createdAtAfter string) (*AdminActivityLogs, error)
ListActivityLogs returns activity logs for admins, starting from createdAtAfter (UNIX timestamp string).
func (*AdminsService) Me ¶
func (s *AdminsService) Me(ctx context.Context) (*Admin, error)
Me identifies the currently authenticated admin.
func (*AdminsService) Retrieve ¶
func (s *AdminsService) Retrieve(ctx context.Context, adminID string) (*AdminDetail, error)
Retrieve retrieves an admin by ID.
func (*AdminsService) SetAway ¶
func (s *AdminsService) SetAway(ctx context.Context, adminID string, req AdminSetAway) (*AdminDetail, error)
SetAway sets the away status of an admin.
type ArticleCreate ¶
type ArticleCreate = gen.CreateArticleRequestSchema
ArticleCreate holds the fields for creating an article.
type ArticleDeleted ¶
type ArticleDeleted = gen.DeletedArticleObjectSchema
ArticleDeleted is the result of deleting an article.
type ArticleList ¶
type ArticleList = gen.ArticleListSchema
ArticleList is a page of Intercom articles.
type ArticleSearch ¶
ArticleSearch holds the parameters for searching articles.
type ArticleSearchResult ¶
type ArticleSearchResult = gen.ArticleSearchResponseSchema
ArticleSearchResult is the result of an article search.
type ArticleUpdate ¶
type ArticleUpdate = gen.UpdateArticleRequestSchema
ArticleUpdate holds the fields for updating an article.
type ArticlesService ¶
type ArticlesService struct {
// contains filtered or unexported fields
}
ArticlesService exposes article-related Intercom API operations.
func (*ArticlesService) Create ¶
func (s *ArticlesService) Create(ctx context.Context, article ArticleCreate) (*Article, error)
Create creates a new article.
func (*ArticlesService) Delete ¶
func (s *ArticlesService) Delete(ctx context.Context, articleID string) (*ArticleDeleted, error)
Delete deletes an article.
func (*ArticlesService) List ¶
func (s *ArticlesService) List(ctx context.Context) (*ArticleList, error)
List returns all articles.
func (*ArticlesService) Search ¶
func (s *ArticlesService) Search(ctx context.Context, search ArticleSearch) (*ArticleSearchResult, error)
Search searches articles by phrase, state, help center, or highlight options.
func (*ArticlesService) Update ¶
func (s *ArticlesService) Update(ctx context.Context, articleID string, article ArticleUpdate) (*Article, error)
Update updates an article.
type AwayStatusReason ¶
type AwayStatusReason = gen.AwayStatusReasonSchema
AwayStatusReason is an Intercom away status reason.
type AwayStatusReasonsService ¶
type AwayStatusReasonsService struct {
// contains filtered or unexported fields
}
AwayStatusReasonsService exposes away status reason Intercom API operations.
func (*AwayStatusReasonsService) List ¶
func (s *AwayStatusReasonsService) List(ctx context.Context) ([]AwayStatusReason, error)
List returns all away status reasons for the workspace.
type BrandsService ¶
type BrandsService struct {
// contains filtered or unexported fields
}
BrandsService exposes brand-related Intercom API operations.
type CallWithTranscript ¶
type CallWithTranscript struct {
AdminId *string `json:"admin_id,omitempty"`
AnsweredAt *gen.Datetime `json:"answered_at,omitempty"`
CallType *string `json:"call_type,omitempty"`
ContactId *string `json:"contact_id,omitempty"`
ConversationId *string `json:"conversation_id,omitempty"`
CreatedAt *gen.Datetime `json:"created_at,omitempty"`
Direction *string `json:"direction,omitempty"`
EndedAt *gen.Datetime `json:"ended_at,omitempty"`
EndedReason *string `json:"ended_reason,omitempty"`
FinRecordingUrl *string `json:"fin_recording_url,omitempty"`
FinTranscriptionUrl *string `json:"fin_transcription_url,omitempty"`
Id *string `json:"id,omitempty"`
InitiatedAt *gen.Datetime `json:"initiated_at,omitempty"`
Phone *string `json:"phone,omitempty"`
RecordingUrl *string `json:"recording_url,omitempty"`
State *string `json:"state,omitempty"`
Transcript []map[string]any `json:"transcript,omitempty"`
TranscriptStatus *string `json:"transcript_status,omitempty"`
TranscriptionUrl *string `json:"transcription_url,omitempty"`
Type *string `json:"type,omitempty"`
UpdatedAt *gen.Datetime `json:"updated_at,omitempty"`
}
CallWithTranscript is a call with its full transcript data.
type CallWithTranscriptList ¶
type CallWithTranscriptList struct {
Data []CallWithTranscript `json:"data,omitempty"`
Type *string `json:"type,omitempty"`
}
CallWithTranscriptList is the response from ListWithTranscripts.
type CallsService ¶
type CallsService struct {
// contains filtered or unexported fields
}
CallsService exposes call-related Intercom API operations.
func (*CallsService) CollectFinVoiceCallByExternalID ¶
func (s *CallsService) CollectFinVoiceCallByExternalID(ctx context.Context, externalID string) (*FinVoiceCall, error)
CollectFinVoiceCallByExternalID returns a registered Fin Voice call by external call ID.
func (*CallsService) CollectFinVoiceCallByID ¶
func (s *CallsService) CollectFinVoiceCallByID(ctx context.Context, id int) (*FinVoiceCall, error)
CollectFinVoiceCallByID returns a registered Fin Voice call by its Intercom ID.
func (*CallsService) CollectFinVoiceCallByPhoneNumber ¶
func (s *CallsService) CollectFinVoiceCallByPhoneNumber(ctx context.Context, phone string) (*FinVoiceCall, error)
CollectFinVoiceCallByPhoneNumber returns a registered Fin Voice call by phone number.
func (*CallsService) CollectFinVoiceCallsByConversationID ¶
func (s *CallsService) CollectFinVoiceCallsByConversationID(ctx context.Context, conversationID string) ([]FinVoiceCall, error)
CollectFinVoiceCallsByConversationID returns all Fin Voice calls for a conversation.
func (*CallsService) GetRecording ¶
GetRecording downloads the recording for a call. The API returns a 302 redirect to a signed URL; this method follows it automatically.
func (*CallsService) GetTranscript ¶
GetTranscript downloads the raw transcript for a call.
func (*CallsService) List ¶
func (s *CallsService) List(ctx context.Context) (*CallList, error)
List returns a paginated list of calls.
func (*CallsService) ListWithOptions ¶ added in v0.1.2
func (s *CallsService) ListWithOptions(ctx context.Context, options PageOptions) (*CallList, error)
ListWithOptions returns a paginated list of calls.
func (*CallsService) ListWithTranscripts ¶
func (s *CallsService) ListWithTranscripts(ctx context.Context, conversationIDs []string) (*CallWithTranscriptList, error)
ListWithTranscripts returns calls with transcripts for up to 20 conversation IDs.
func (*CallsService) RegisterFinVoiceCall ¶
func (s *CallsService) RegisterFinVoiceCall(ctx context.Context, req RegisterFinVoiceCallRequest) (*FinVoiceCall, error)
RegisterFinVoiceCall registers a new Fin Voice call.
func (*CallsService) Transcript ¶
Transcript retrieves the transcript for a call.
type Client ¶
type Client struct {
Admins *AdminsService
AIContent *AIContentService
Articles *ArticlesService
AwayStatusReasons *AwayStatusReasonsService
Brands *BrandsService
Calls *CallsService
Collections *CollectionsService
Companies *CompaniesService
Contacts *ContactsService
Conversations *ConversationsService
CustomObjects *CustomObjectsService
DataAttributes *DataAttributesService
DataEvents *DataEventsService
Emails *EmailsService
Fin *FinService
HelpCenters *HelpCentersService
InternalArticles *InternalArticlesService
Messages *MessagesService
News *NewsService
Notes *NotesService
PhoneSwitches *PhoneSwitchesService
Segments *SegmentsService
SubscriptionTypes *SubscriptionTypesService
Tags *TagsService
Teams *TeamsService
Tickets *TicketsService
Visitors *VisitorsService
Workspace *WorkspaceService
// contains filtered or unexported fields
}
Client is the root Intercom API client.
func NewClientFromEnv ¶
NewClientFromEnv creates an Intercom API client using an access token from the environment.
func NewClientFromEnvVar ¶
NewClientFromEnvVar creates an Intercom API client using an access token from the named environment variable.
type Collection ¶
type Collection = gen.CollectionSchema
Collection is an Intercom help center collection.
type CollectionCreate ¶
type CollectionCreate = gen.CreateCollectionRequestSchema
CollectionCreate holds the fields for creating a collection.
type CollectionList ¶
type CollectionList = gen.CollectionListSchema
CollectionList is a list of Intercom collections.
type CollectionUpdate ¶
type CollectionUpdate = gen.UpdateCollectionRequestSchema
CollectionUpdate holds the fields for updating a collection.
type CollectionsService ¶
type CollectionsService struct {
// contains filtered or unexported fields
}
CollectionsService exposes collection-related Intercom API operations.
func (*CollectionsService) Create ¶
func (s *CollectionsService) Create(ctx context.Context, collection CollectionCreate) (*Collection, error)
Create creates a collection.
func (*CollectionsService) Delete ¶
func (s *CollectionsService) Delete(ctx context.Context, collectionID string) error
Delete deletes a collection by ID.
func (*CollectionsService) List ¶
func (s *CollectionsService) List(ctx context.Context) (*CollectionList, error)
List returns all collections.
func (*CollectionsService) Retrieve ¶
func (s *CollectionsService) Retrieve(ctx context.Context, collectionID string) (*Collection, error)
Retrieve returns a collection by ID.
func (*CollectionsService) Update ¶
func (s *CollectionsService) Update(ctx context.Context, collectionID string, collection CollectionUpdate) (*Collection, error)
Update updates a collection by ID.
type CompaniesService ¶
type CompaniesService struct {
// contains filtered or unexported fields
}
CompaniesService exposes company-related Intercom API operations.
func (*CompaniesService) AttachContact ¶
func (s *CompaniesService) AttachContact(ctx context.Context, contactID, companyID string) (*Company, error)
AttachContact attaches a contact to a company.
func (*CompaniesService) CreateOrUpdate ¶
func (s *CompaniesService) CreateOrUpdate(ctx context.Context, company CompanyCreate) (*Company, error)
CreateOrUpdate creates or updates a company.
func (*CompaniesService) Delete ¶
func (s *CompaniesService) Delete(ctx context.Context, companyID string) (*CompanyDeleted, error)
Delete deletes a company by its Intercom-assigned ID.
func (*CompaniesService) DetachContact ¶
func (s *CompaniesService) DetachContact(ctx context.Context, contactID, companyID string) (*Company, error)
DetachContact detaches a contact from a company.
func (*CompaniesService) List ¶ added in v0.1.2
func (s *CompaniesService) List(ctx context.Context, options CompanyListOptions) (*CompanyList, error)
List returns companies matching the supplied filters and pagination options.
func (*CompaniesService) ListAll ¶
func (s *CompaniesService) ListAll(ctx context.Context) (*CompanyList, error)
ListAll returns all companies using cursor-based pagination.
func (*CompaniesService) ListAllWithOptions ¶ added in v0.1.2
func (s *CompaniesService) ListAllWithOptions(ctx context.Context, options CompanyListAllOptions) (*CompanyList, error)
ListAllWithOptions returns all companies using pagination and ordering options.
func (*CompaniesService) ListContacts ¶
func (s *CompaniesService) ListContacts(ctx context.Context, companyID string) (*CompanyContacts, error)
ListContacts returns contacts attached to a company.
func (*CompaniesService) ListForContact ¶
func (s *CompaniesService) ListForContact(ctx context.Context, contactID string) (*ContactCompanies, error)
ListForContact returns companies a contact belongs to.
func (*CompaniesService) ListSegments ¶
func (s *CompaniesService) ListSegments(ctx context.Context, companyID string) (*CompanySegmentsAttached, error)
ListSegments returns segments a company belongs to.
func (*CompaniesService) RetrieveByID ¶
func (s *CompaniesService) RetrieveByID(ctx context.Context, companyID string) (*CompanyList, error)
RetrieveByID retrieves companies matching the given company_id (external ID set by the caller).
func (*CompaniesService) Scroll ¶
func (s *CompaniesService) Scroll(ctx context.Context) (*CompanyScroll, error)
Scroll returns companies using the scroll API for large datasets.
func (*CompaniesService) ScrollWithOptions ¶ added in v0.1.2
func (s *CompaniesService) ScrollWithOptions(ctx context.Context, options CompanyScrollOptions) (*CompanyScroll, error)
ScrollWithOptions returns companies using the scroll API for large datasets.
func (*CompaniesService) Update ¶
func (s *CompaniesService) Update(ctx context.Context, companyID string, update CompanyUpdate) (*Company, error)
Update updates a company by its Intercom-assigned ID.
type CompanyContacts ¶
type CompanyContacts = gen.CompanyAttachedContactsSchema
CompanyContacts is a list of contacts attached to a company.
type CompanyCreate ¶
type CompanyCreate = gen.CreateOrUpdateCompanyRequestSchema
CompanyCreate holds the fields for creating or updating a company.
type CompanyDeleted ¶
type CompanyDeleted = gen.DeletedCompanyObjectSchema
CompanyDeleted is the result of deleting a company.
type CompanyList ¶
type CompanyList = gen.CompanyListSchema
CompanyList is a page of Intercom companies.
type CompanyListAllOptions ¶ added in v0.1.2
CompanyListAllOptions controls pagination and ordering for listing all companies.
type CompanyListOptions ¶ added in v0.1.2
type CompanyListOptions struct {
Name string
CompanyID string
TagID string
SegmentID string
Page int
PerPage int
}
CompanyListOptions controls filters and pagination for the companies endpoint.
type CompanyScroll ¶
type CompanyScroll = gen.CompanyScrollSchema
CompanyScroll is a scroll page of Intercom companies.
type CompanyScrollOptions ¶ added in v0.1.2
type CompanyScrollOptions struct {
ScrollParam string
}
CompanyScrollOptions controls the company scroll cursor.
type CompanySegmentsAttached ¶
type CompanySegmentsAttached = gen.CompanyAttachedSegmentsSchema
CompanySegmentsAttached is a list of segments a company belongs to.
type CompanyUpdate ¶
type CompanyUpdate = gen.UpdateCompanyRequestSchema
CompanyUpdate holds the fields for updating a company.
type ContactArchived ¶
type ContactArchived = gen.ContactArchived
ContactArchived is the result of archiving a contact.
type ContactBlocked ¶
type ContactBlocked = gen.ContactBlockedSchema
ContactBlocked is the result of blocking a contact.
type ContactCompanies ¶
type ContactCompanies = gen.ContactAttachedCompaniesSchema
ContactCompanies is the list of companies a contact belongs to.
type ContactCreate ¶
type ContactCreate = gen.CreateContactRequestSchema
ContactCreate holds the fields for creating a contact.
type ContactDeleted ¶
type ContactDeleted = gen.ContactDeleted
ContactDeleted is the result of deleting a contact.
type ContactIterator ¶ added in v0.1.3
type ContactIterator struct {
// contains filtered or unexported fields
}
ContactIterator lazily iterates over contact search results.
func (*ContactIterator) Contact ¶ added in v0.1.3
func (i *ContactIterator) Contact() *Contact
Contact returns the current contact. It returns nil before the first successful Next call.
func (*ContactIterator) Err ¶ added in v0.1.3
func (i *ContactIterator) Err() error
Err returns the first error encountered while fetching pages.
func (*ContactIterator) Next ¶ added in v0.1.3
func (i *ContactIterator) Next() bool
Next advances the iterator to the next contact.
type ContactList ¶
type ContactList = gen.ContactListSchema
ContactList is a page of Intercom contacts.
type ContactSearch ¶
type ContactSearch struct {
Field string
Operator ContactSearchOperator
Value any
PerPage int
StartingAfter string
}
ContactSearch describes a single-filter contact search.
type ContactSearchOperator ¶
type ContactSearchOperator string
ContactSearchOperator is an Intercom contact search operator.
const ( ContactSearchEquals ContactSearchOperator = "=" ContactSearchNotEquals ContactSearchOperator = "!=" ContactSearchGreaterThan ContactSearchOperator = ">" ContactSearchLessThan ContactSearchOperator = "<" ContactSearchContains ContactSearchOperator = "~" )
type ContactSegments ¶
type ContactSegments = gen.ContactSegmentsSchema
ContactSegments is the list of segments a contact belongs to.
type ContactUnarchived ¶
type ContactUnarchived = gen.ContactUnarchived
ContactUnarchived is the result of unarchiving a contact.
type ContactUpdate ¶
type ContactUpdate = gen.UpdateContactRequestSchema
ContactUpdate holds the fields for updating a contact.
type ContactsService ¶
type ContactsService struct {
// contains filtered or unexported fields
}
ContactsService exposes contact-related Intercom API operations.
func (*ContactsService) Archive ¶
func (s *ContactsService) Archive(ctx context.Context, contactID string) (*ContactArchived, error)
Archive archives a contact.
func (*ContactsService) AttachSubscription ¶
func (s *ContactsService) AttachSubscription(ctx context.Context, contactID, subscriptionID, consentType string) (*SubscriptionType, error)
AttachSubscription attaches a subscription type to a contact.
func (*ContactsService) Block ¶
func (s *ContactsService) Block(ctx context.Context, contactID string) (*ContactBlocked, error)
Block blocks a contact.
func (*ContactsService) Create ¶
func (s *ContactsService) Create(ctx context.Context, contact ContactCreate) (*Contact, error)
Create creates a new contact.
func (*ContactsService) CreateNote ¶
func (s *ContactsService) CreateNote(ctx context.Context, contactID string, body string, adminID string) (*Note, error)
CreateNote creates a note on a contact.
func (*ContactsService) Delete ¶
func (s *ContactsService) Delete(ctx context.Context, contactID string) (*ContactDeleted, error)
Delete deletes a contact.
func (*ContactsService) DetachSubscription ¶
func (s *ContactsService) DetachSubscription(ctx context.Context, contactID, subscriptionID string) (*SubscriptionType, error)
DetachSubscription detaches a subscription type from a contact.
func (*ContactsService) GetByExternalID ¶
GetByExternalID retrieves a contact by external ID.
func (*ContactsService) List ¶
func (s *ContactsService) List(ctx context.Context) (*ContactList, error)
List returns contacts.
func (*ContactsService) ListSegments ¶
func (s *ContactsService) ListSegments(ctx context.Context, contactID string) (*ContactSegments, error)
ListSegments returns segments a contact belongs to.
func (*ContactsService) ListSubscriptions ¶
func (s *ContactsService) ListSubscriptions(ctx context.Context, contactID string) (*SubscriptionTypeList, error)
ListSubscriptions returns subscription types for a contact.
func (*ContactsService) Search ¶
func (s *ContactsService) Search(ctx context.Context, search ContactSearch) (*ContactList, error)
Search searches contacts using one Intercom search filter.
func (*ContactsService) SearchIter ¶ added in v0.1.3
func (s *ContactsService) SearchIter(ctx context.Context, search ContactSearch) *ContactIterator
SearchIter returns a lazy iterator for contact search results.
func (*ContactsService) Unarchive ¶
func (s *ContactsService) Unarchive(ctx context.Context, contactID string) (*ContactUnarchived, error)
Unarchive unarchives a contact.
func (*ContactsService) Update ¶
func (s *ContactsService) Update(ctx context.Context, contactID string, contact ContactUpdate) (*Contact, error)
Update updates an existing contact.
type ContentImportSource ¶
type ContentImportSource = gen.ContentImportSourceSchema
ContentImportSource is an Intercom AI content import source.
type ContentImportSourceCreate ¶
type ContentImportSourceCreate = gen.CreateContentImportSourceRequestSchema
ContentImportSourceCreate holds the fields for creating a content import source.
type ContentImportSourceList ¶
type ContentImportSourceList = gen.ContentImportSourcesListSchema
ContentImportSourceList is a list of content import sources.
type ContentImportSourceUpdate ¶
type ContentImportSourceUpdate = gen.UpdateContentImportSourceRequestSchema
ContentImportSourceUpdate holds the fields for updating a content import source.
type Conversation ¶
type Conversation = gen.ConversationSchema
Conversation is an Intercom conversation.
type ConversationAdminReply ¶
type ConversationAdminReply = gen.AdminReplyConversationRequestSchema
ConversationAdminReply holds the fields for replying to a conversation as an admin.
type ConversationAssign ¶
type ConversationAssign = gen.AssignConversationRequestSchema
ConversationAssign holds the fields for assigning a conversation.
type ConversationAttachContact ¶
type ConversationAttachContact = gen.AttachContactToConversationRequestSchema
ConversationAttachContact holds the fields for attaching a contact to a conversation.
type ConversationClose ¶
type ConversationClose = gen.CloseConversationRequestSchema
ConversationClose holds the fields for closing a conversation.
type ConversationContactReply ¶
type ConversationContactReply = gen.ContactReplyBaseRequestSchema
ConversationContactReply holds the fields for replying to a conversation as a contact.
type ConversationCreate ¶
type ConversationCreate = gen.CreateConversationRequestSchema
ConversationCreate holds the fields for creating a conversation.
type ConversationDeleted ¶
type ConversationDeleted = gen.ConversationDeletedSchema
ConversationDeleted is the result of deleting a conversation.
type ConversationDetachContact ¶
type ConversationDetachContact = gen.DetachContactFromConversationRequest
ConversationDetachContact holds the fields for detaching a contact from a conversation.
type ConversationHandlingEvent ¶
type ConversationHandlingEvent = gen.HandlingEventSchema
ConversationHandlingEvent is a pause or resume event recorded for a conversation.
type ConversationHandlingEventList ¶
type ConversationHandlingEventList = gen.HandlingEventListSchema
ConversationHandlingEventList is a list of handling events for a conversation.
type ConversationIterator ¶ added in v0.1.3
type ConversationIterator struct {
// contains filtered or unexported fields
}
ConversationIterator lazily iterates over conversation list items.
func (*ConversationIterator) Conversation ¶ added in v0.1.3
func (i *ConversationIterator) Conversation() *ConversationListItem
Conversation returns the current conversation. It returns nil before the first successful Next call.
func (*ConversationIterator) Err ¶ added in v0.1.3
func (i *ConversationIterator) Err() error
Err returns the first error encountered while fetching pages.
func (*ConversationIterator) Next ¶ added in v0.1.3
func (i *ConversationIterator) Next() bool
Next advances the iterator to the next conversation.
type ConversationList ¶
type ConversationList = gen.ConversationListSchema
ConversationList is a page of Intercom conversations.
type ConversationListItem ¶ added in v0.1.3
type ConversationListItem = gen.ConversationListItemSchema
ConversationListItem is a conversation item returned by list and search endpoints.
type ConversationMessage ¶
type ConversationMessage = gen.MessageSchema
ConversationMessage is the result of creating a conversation.
type ConversationOpen ¶
type ConversationOpen = gen.OpenConversationRequestSchema
ConversationOpen holds the fields for re-opening a conversation.
type ConversationRedactPart ¶
type ConversationRedactPart = gen.RedactConversationRequest0
ConversationRedactPart holds the fields for redacting a conversation part.
type ConversationRedactSource ¶
type ConversationRedactSource = gen.RedactConversationRequest1
ConversationRedactSource holds the fields for redacting a conversation source.
type ConversationSearchQuery ¶
type ConversationSearchQuery = gen.SearchRequestSchema
ConversationSearchQuery holds the query for searching conversations.
type ConversationSnooze ¶
type ConversationSnooze = gen.SnoozeConversationRequestSchema
ConversationSnooze holds the fields for snoozing a conversation.
type ConversationToTicket ¶
type ConversationToTicket = gen.ConvertConversationToTicketRequestSchema
ConversationToTicket holds the fields for converting a conversation to a ticket.
type ConversationUpdate ¶
type ConversationUpdate = gen.UpdateConversationRequestSchema
ConversationUpdate holds the fields for updating a conversation.
type ConversationsService ¶
type ConversationsService struct {
// contains filtered or unexported fields
}
ConversationsService exposes conversation-related Intercom API operations.
func (*ConversationsService) Assign ¶
func (s *ConversationsService) Assign(ctx context.Context, conversationID string, assign ConversationAssign) (*Conversation, error)
Assign assigns a conversation to an admin or team.
func (*ConversationsService) AttachContact ¶
func (s *ConversationsService) AttachContact(ctx context.Context, conversationID string, req ConversationAttachContact) (*Conversation, error)
AttachContact attaches a contact to a conversation.
func (*ConversationsService) AttachTag ¶
func (s *ConversationsService) AttachTag(ctx context.Context, conversationID, tagID, adminID string) (*Tag, error)
AttachTag attaches a tag to a conversation.
func (*ConversationsService) Close ¶
func (s *ConversationsService) Close(ctx context.Context, conversationID string, req ConversationClose) (*Conversation, error)
Close closes a conversation.
func (*ConversationsService) ConvertToTicket ¶
func (s *ConversationsService) ConvertToTicket(ctx context.Context, conversationID string, req ConversationToTicket) (*Ticket, error)
ConvertToTicket converts a conversation to a ticket.
func (*ConversationsService) Create ¶
func (s *ConversationsService) Create(ctx context.Context, conversation ConversationCreate) (*ConversationMessage, error)
Create creates a new conversation initiated from a contact.
func (*ConversationsService) Delete ¶
func (s *ConversationsService) Delete(ctx context.Context, conversationID string) (*ConversationDeleted, error)
Delete deletes a conversation.
func (*ConversationsService) DetachContact ¶
func (s *ConversationsService) DetachContact(ctx context.Context, conversationID, contactID string, req ConversationDetachContact) (*Conversation, error)
DetachContact detaches a contact from a conversation.
func (*ConversationsService) DetachTag ¶
func (s *ConversationsService) DetachTag(ctx context.Context, conversationID, tagID, adminID string) (*Tag, error)
DetachTag detaches a tag from a conversation.
func (*ConversationsService) Get ¶
func (s *ConversationsService) Get(ctx context.Context, conversationID string) (*Conversation, error)
Get retrieves a conversation by Intercom conversation ID.
func (*ConversationsService) List ¶
func (s *ConversationsService) List(ctx context.Context) (*ConversationList, error)
List returns all conversations.
func (*ConversationsService) ListHandlingEvents ¶
func (s *ConversationsService) ListHandlingEvents(ctx context.Context, conversationID string) (*ConversationHandlingEventList, error)
ListHandlingEvents returns pause and resume events for a conversation.
func (*ConversationsService) ListIter ¶ added in v0.1.3
func (s *ConversationsService) ListIter(ctx context.Context, options CursorPageOptions) *ConversationIterator
ListIter returns a lazy iterator for conversations.
func (*ConversationsService) ListWithOptions ¶ added in v0.1.2
func (s *ConversationsService) ListWithOptions(ctx context.Context, options CursorPageOptions) (*ConversationList, error)
ListWithOptions returns conversations using cursor pagination options.
func (*ConversationsService) Open ¶
func (s *ConversationsService) Open(ctx context.Context, conversationID string, req ConversationOpen) (*Conversation, error)
Open re-opens a snoozed or closed conversation.
func (*ConversationsService) RedactPart ¶
func (s *ConversationsService) RedactPart(ctx context.Context, req ConversationRedactPart) (*Conversation, error)
RedactPart redacts a message part from a conversation.
func (*ConversationsService) RedactSource ¶
func (s *ConversationsService) RedactSource(ctx context.Context, req ConversationRedactSource) (*Conversation, error)
RedactSource redacts a source message from a conversation.
func (*ConversationsService) Reply ¶
func (s *ConversationsService) Reply(ctx context.Context, conversationID string, reply ConversationAdminReply) (*Conversation, error)
Reply sends an admin reply to a conversation.
func (*ConversationsService) ReplyAsContact ¶
func (s *ConversationsService) ReplyAsContact(ctx context.Context, conversationID string, reply ConversationContactReply) (*Conversation, error)
ReplyAsContact sends a contact reply to a conversation.
func (*ConversationsService) Search ¶
func (s *ConversationsService) Search(ctx context.Context, query ConversationSearchQuery) (*ConversationList, error)
Search searches conversations using an Intercom search query.
func (*ConversationsService) SearchIter ¶ added in v0.1.3
func (s *ConversationsService) SearchIter(ctx context.Context, query ConversationSearchQuery, options CursorPageOptions) *ConversationIterator
SearchIter returns a lazy iterator for conversation search results.
func (*ConversationsService) SearchWithOptions ¶ added in v0.1.2
func (s *ConversationsService) SearchWithOptions(ctx context.Context, query ConversationSearchQuery, options CursorPageOptions) (*ConversationList, error)
SearchWithOptions searches conversations using cursor pagination options.
func (*ConversationsService) Snooze ¶
func (s *ConversationsService) Snooze(ctx context.Context, conversationID string, req ConversationSnooze) (*Conversation, error)
Snooze snoozes a conversation until the given time.
func (*ConversationsService) Update ¶
func (s *ConversationsService) Update(ctx context.Context, conversationID string, conversation ConversationUpdate) (*Conversation, error)
Update updates an existing conversation.
type CursorPageOptions ¶ added in v0.1.2
CursorPageOptions controls cursor pagination for endpoints that use per_page and starting_after query parameters.
type CustomObjectInstance ¶
type CustomObjectInstance = gen.CustomObjectInstanceSchema
CustomObjectInstance is an Intercom custom object instance.
type CustomObjectInstanceCreateOrUpdate ¶
type CustomObjectInstanceCreateOrUpdate = gen.CreateOrUpdateCustomObjectInstanceRequestSchema
CustomObjectInstanceCreateOrUpdate holds the fields for creating or updating a custom object instance.
type CustomObjectInstanceDeleted ¶
type CustomObjectInstanceDeleted = gen.CustomObjectInstanceDeletedSchema
CustomObjectInstanceDeleted is a deleted Intercom custom object instance response.
type CustomObjectsService ¶
type CustomObjectsService struct {
// contains filtered or unexported fields
}
CustomObjectsService exposes custom-object instance Intercom API operations.
func (*CustomObjectsService) CreateOrUpdate ¶
func (s *CustomObjectsService) CreateOrUpdate(ctx context.Context, customObjectType string, instance CustomObjectInstanceCreateOrUpdate) (*CustomObjectInstance, error)
CreateOrUpdate creates or updates a custom object instance for a custom object type.
func (*CustomObjectsService) Delete ¶
func (s *CustomObjectsService) Delete(ctx context.Context, customObjectType, instanceID string) (*CustomObjectInstanceDeleted, error)
Delete deletes a custom object instance by Intercom ID.
func (*CustomObjectsService) DeleteByExternalID ¶
func (s *CustomObjectsService) DeleteByExternalID(ctx context.Context, customObjectType, externalID string) (*CustomObjectInstanceDeleted, error)
DeleteByExternalID deletes a custom object instance by external ID.
func (*CustomObjectsService) Get ¶
func (s *CustomObjectsService) Get(ctx context.Context, customObjectType, instanceID string) (*CustomObjectInstance, error)
Get returns a custom object instance by Intercom ID.
func (*CustomObjectsService) GetByExternalID ¶
func (s *CustomObjectsService) GetByExternalID(ctx context.Context, customObjectType, externalID string) (*CustomObjectInstance, error)
GetByExternalID returns a custom object instance by external ID.
type DataAttribute ¶
type DataAttribute = gen.DataAttributeSchema
DataAttribute is an Intercom data attribute.
type DataAttributeCreate ¶
type DataAttributeCreate struct {
Name string
Model DataAttributeModel
DataType DataAttributeDataType
Description *string
MessengerWritable *bool
Options []string
}
DataAttributeCreate holds the fields for creating a data attribute.
type DataAttributeDataType ¶
type DataAttributeDataType string
DataAttributeDataType identifies the stored value type for a data attribute.
const ( DataAttributeDataTypeString DataAttributeDataType = "string" DataAttributeDataTypeInteger DataAttributeDataType = "integer" DataAttributeDataTypeFloat DataAttributeDataType = "float" DataAttributeDataTypeBoolean DataAttributeDataType = "boolean" DataAttributeDataTypeDate DataAttributeDataType = "date" DataAttributeDataTypeList DataAttributeDataType = "list" )
type DataAttributeList ¶
type DataAttributeList = gen.DataAttributeListSchema
DataAttributeList is a list of Intercom data attributes.
type DataAttributeListParams ¶
type DataAttributeListParams struct {
Model DataAttributeModel
IncludeArchived bool
}
DataAttributeListParams configures data attribute listing.
type DataAttributeModel ¶
type DataAttributeModel string
DataAttributeModel identifies which Intercom model a data attribute belongs to.
const ( DataAttributeModelContact DataAttributeModel = "contact" DataAttributeModelCompany DataAttributeModel = "company" DataAttributeModelConversation DataAttributeModel = "conversation" )
type DataAttributeUpdate ¶
type DataAttributeUpdate struct {
Archived *bool
Description *string
MessengerWritable *bool
Options []string
}
DataAttributeUpdate holds the fields for updating a data attribute.
type DataAttributesService ¶
type DataAttributesService struct {
// contains filtered or unexported fields
}
DataAttributesService exposes data-attribute Intercom API operations.
func (*DataAttributesService) Create ¶
func (s *DataAttributesService) Create(ctx context.Context, attribute DataAttributeCreate) (*DataAttribute, error)
Create creates a new contact or company data attribute.
func (*DataAttributesService) List ¶
func (s *DataAttributesService) List(ctx context.Context, params DataAttributeListParams) (*DataAttributeList, error)
List returns data attributes for the workspace.
func (*DataAttributesService) Update ¶
func (s *DataAttributesService) Update(ctx context.Context, dataAttributeID string, attribute DataAttributeUpdate) (*DataAttribute, error)
Update updates or archives a data attribute.
type DataEventCreate ¶
type DataEventCreate struct {
EventName string
CreatedAt *int
UserID *string
Email *string
ID *string
Metadata map[string]any
}
DataEventCreate holds the fields for submitting a data event.
type DataEventListFilter ¶
DataEventListFilter identifies which user's events to query.
type DataEventSummariesCreate ¶
type DataEventSummariesCreate struct {
UserID string
EventSummaries []DataEventSummaryCreate
}
DataEventSummariesCreate holds the fields for creating event summaries.
type DataEventSummary ¶
type DataEventSummary = gen.DataEventSummarySchema
DataEventSummary is an Intercom data event summary response.
type DataEventSummaryCreate ¶
DataEventSummaryCreate holds the fields for a single summary item.
type DataEventSummaryItem ¶
type DataEventSummaryItem = gen.DataEventSummaryItemSchema
DataEventSummaryItem is a summarized data event.
type DataEventsService ¶
type DataEventsService struct {
// contains filtered or unexported fields
}
DataEventsService exposes Intercom data-event API operations.
func (*DataEventsService) Create ¶
func (s *DataEventsService) Create(ctx context.Context, event DataEventCreate) error
Create submits a data event.
func (*DataEventsService) CreateSummaries ¶
func (s *DataEventsService) CreateSummaries(ctx context.Context, summaries DataEventSummariesCreate) error
CreateSummaries submits summarized data events for a user.
func (*DataEventsService) List ¶
func (s *DataEventsService) List(ctx context.Context, filter DataEventListFilter) (*DataEventSummary, error)
List returns data event summaries for a user or lead.
type DataExport ¶
type DataExport = gen.DataExportSchema
DataExport is an Intercom content data export job.
type DataExportCreate ¶
type DataExportCreate = gen.CreateDataExportsRequestSchema
DataExportCreate holds the fields for creating a content data export.
type EmailList ¶
type EmailList = gen.EmailListSchema
EmailList is a list of Intercom sender email settings.
type EmailSetting ¶
type EmailSetting = gen.EmailSettingSchema
EmailSetting is an Intercom sender email setting.
type EmailsService ¶
type EmailsService struct {
// contains filtered or unexported fields
}
EmailsService exposes email-setting Intercom API operations.
func (*EmailsService) List ¶
func (s *EmailsService) List(ctx context.Context) (*EmailList, error)
List returns sender email settings for the workspace.
func (*EmailsService) Retrieve ¶
func (s *EmailsService) Retrieve(ctx context.Context, emailID string) (*EmailSetting, error)
Retrieve fetches a sender email setting by ID.
type ErrorResponse ¶
type ErrorResponse struct {
StatusCode int
Type string `json:"type"`
RequestID string `json:"request_id"`
Errors []Error `json:"errors"`
Body string `json:"-"`
}
ErrorResponse is returned when Intercom responds with a non-2xx status code.
func (*ErrorResponse) Error ¶
func (e *ErrorResponse) Error() string
type ExternalPage ¶
type ExternalPage = gen.ExternalPageSchema
ExternalPage is an Intercom AI external page.
type ExternalPageCreate ¶
type ExternalPageCreate = gen.CreateExternalPageRequestSchema
ExternalPageCreate holds the fields for creating an external page.
type ExternalPageList ¶
type ExternalPageList = gen.ExternalPagesListSchema
ExternalPageList is a list of external pages.
type ExternalPageUpdate ¶
type ExternalPageUpdate = gen.UpdateExternalPageRequestSchema
ExternalPageUpdate holds the fields for updating an external page.
type FinAttachment ¶
type FinAttachment = gen.FinAgentAttachmentSchema
FinAttachment is an attachment included with a Fin request.
type FinAttachmentType ¶
type FinAttachmentType = gen.FinAgentAttachmentType
FinAttachmentType identifies the type of attachment included with a Fin request.
const ( FinAttachmentTypeFile FinAttachmentType = gen.File FinAttachmentTypeURL FinAttachmentType = gen.Url )
type FinConversationAttributeErrors ¶
type FinConversationAttributeErrors struct {
Attributes *map[string]string `json:"attributes,omitempty"`
}
FinConversationAttributeErrors groups validation errors for a Fin object.
type FinConversationErrors ¶
type FinConversationErrors struct {
Conversation *FinConversationAttributeErrors `json:"conversation,omitempty"`
User *FinConversationAttributeErrors `json:"user,omitempty"`
}
FinConversationErrors groups validation errors returned by Fin conversation endpoints.
type FinConversationMetadata ¶
type FinConversationMetadata = gen.FinAgentConversationMetadataSchema
FinConversationMetadata provides extra context for a Fin conversation.
type FinConversationResponse ¶
type FinConversationResponse struct {
ConversationID *string `json:"conversation_id,omitempty"`
CreatedAtMs *string `json:"created_at_ms,omitempty"`
Errors *FinConversationErrors `json:"errors,omitempty"`
SSESubscriptionURL *string `json:"sse_subscription_url,omitempty"`
Status *string `json:"status,omitempty"`
UserID *string `json:"user_id,omitempty"`
}
FinConversationResponse is the response from Fin conversation APIs.
type FinMessage ¶
type FinMessage = gen.FinAgentMessageSchema
FinMessage is a message exchanged within a Fin conversation.
type FinMessageAuthor ¶
type FinMessageAuthor = gen.FinAgentMessageAuthor
FinMessageAuthor identifies who sent a Fin conversation message.
const ( FinMessageAuthorAgent FinMessageAuthor = gen.FinAgentMessageAuthorAgent FinMessageAuthorFin FinMessageAuthor = gen.FinAgentMessageAuthorFin FinMessageAuthorUser FinMessageAuthor = gen.FinAgentMessageAuthorUser )
type FinReply ¶
type FinReply struct {
Attachments *[]FinAttachment `json:"attachments,omitempty"`
ConversationId string `json:"conversation_id"`
Message FinMessage `json:"message"`
User FinUser `json:"user"`
}
FinReply is a request to continue a Fin conversation.
type FinService ¶
type FinService struct {
// contains filtered or unexported fields
}
FinService exposes Fin-related Intercom API operations.
func (*FinService) GetVoiceCallByExternalID ¶
func (s *FinService) GetVoiceCallByExternalID(ctx context.Context, externalID string) (*FinVoiceCall, error)
GetVoiceCallByExternalID retrieves a Fin voice call by external ID.
func (*FinService) GetVoiceCallByID ¶
func (s *FinService) GetVoiceCallByID(ctx context.Context, id string) (*FinVoiceCall, error)
GetVoiceCallByID retrieves a Fin voice call by ID.
func (*FinService) GetVoiceCallByPhoneNumber ¶
func (s *FinService) GetVoiceCallByPhoneNumber(ctx context.Context, phoneNumber string) (*FinVoiceCall, error)
GetVoiceCallByPhoneNumber retrieves a Fin voice call lookup by phone number.
func (*FinService) ListVoiceCallsByConversation ¶
func (s *FinService) ListVoiceCallsByConversation(ctx context.Context, conversationID string) ([]FinVoiceCall, error)
ListVoiceCallsByConversation returns Fin voice calls for a conversation.
func (*FinService) RegisterVoiceCall ¶
func (s *FinService) RegisterVoiceCall(ctx context.Context, req RegisterFinVoiceCallRequest) (*FinVoiceCall, error)
RegisterVoiceCall registers a Fin voice call.
func (*FinService) Reply ¶
func (s *FinService) Reply(ctx context.Context, req FinReply) (*FinConversationResponse, error)
Reply continues a Fin conversation.
func (*FinService) StartConversation ¶
func (s *FinService) StartConversation(ctx context.Context, req FinStartConversation) (*FinConversationResponse, error)
StartConversation starts a Fin conversation.
type FinStartConversation ¶
type FinStartConversation struct {
Attachments *[]FinAttachment `json:"attachments,omitempty"`
ConversationId string `json:"conversation_id"`
ConversationMetadata *FinConversationMetadata `json:"conversation_metadata,omitempty"`
Message FinMessage `json:"message"`
User FinUser `json:"user"`
}
FinStartConversation is a request to start a Fin conversation.
type FinUser ¶
type FinUser = gen.FinAgentUserSchema
FinUser identifies the user participating in a Fin conversation.
type FinVoiceCall ¶
type FinVoiceCall = gen.AiCallResponseSchema
FinVoiceCall is the response for a Fin Voice call registration or lookup.
type FinVoiceCallSource ¶
type FinVoiceCallSource = gen.RegisterFinVoiceCallRequestSource
FinVoiceCallSource identifies the call provider for Fin Voice calls.
const ( FinVoiceCallSourceAWSConnect FinVoiceCallSource = gen.AwsConnect FinVoiceCallSourceFive9 FinVoiceCallSource = gen.Five9 FinVoiceCallSourceZoomPhone FinVoiceCallSource = gen.ZoomPhone )
type HelpCenterList ¶
type HelpCenterList = gen.HelpCenterListSchema
HelpCenterList is a list of Intercom help centers.
type HelpCentersService ¶
type HelpCentersService struct {
// contains filtered or unexported fields
}
HelpCentersService exposes help-center-related Intercom API operations.
func (*HelpCentersService) List ¶
func (s *HelpCentersService) List(ctx context.Context) (*HelpCenterList, error)
List returns all help centers.
func (*HelpCentersService) Retrieve ¶
func (s *HelpCentersService) Retrieve(ctx context.Context, helpCenterID string) (*HelpCenter, error)
Retrieve returns a help center by ID.
type IPAllowlist ¶
type IPAllowlist = gen.IpAllowlistSchema
IPAllowlist is the workspace IP allowlist configuration.
type InternalArticle ¶
type InternalArticle = gen.InternalArticleSchema
InternalArticle is an Intercom internal article.
type InternalArticleCreate ¶
type InternalArticleCreate = gen.CreateInternalArticleRequestSchema
InternalArticleCreate holds the fields for creating an internal article.
type InternalArticleDeleted ¶
type InternalArticleDeleted = gen.DeletedInternalArticleObjectSchema
InternalArticleDeleted is the result of deleting an internal article.
type InternalArticleList ¶
type InternalArticleList = gen.InternalArticleListSchema
InternalArticleList is a list of internal articles.
type InternalArticleSearchResult ¶
type InternalArticleSearchResult = gen.InternalArticleSearchResponseSchema
InternalArticleSearchResult is the result of an internal article search.
type InternalArticleUpdate ¶
type InternalArticleUpdate = gen.UpdateInternalArticleRequestSchema
InternalArticleUpdate holds the fields for updating an internal article.
type InternalArticlesService ¶
type InternalArticlesService struct {
// contains filtered or unexported fields
}
InternalArticlesService exposes internal-article-related Intercom API operations.
func (*InternalArticlesService) Create ¶
func (s *InternalArticlesService) Create(ctx context.Context, article InternalArticleCreate) (*InternalArticle, error)
Create creates an internal article.
func (*InternalArticlesService) Delete ¶
func (s *InternalArticlesService) Delete(ctx context.Context, articleID string) (*InternalArticleDeleted, error)
Delete deletes an internal article by ID.
func (*InternalArticlesService) List ¶
func (s *InternalArticlesService) List(ctx context.Context) (*InternalArticleList, error)
List returns all internal articles.
func (*InternalArticlesService) Retrieve ¶
func (s *InternalArticlesService) Retrieve(ctx context.Context, articleID string) (*InternalArticle, error)
Retrieve returns an internal article by ID.
func (*InternalArticlesService) Search ¶
func (s *InternalArticlesService) Search(ctx context.Context, folderID *string) (*InternalArticleSearchResult, error)
Search searches internal articles.
func (*InternalArticlesService) Update ¶
func (s *InternalArticlesService) Update(ctx context.Context, articleID string, article InternalArticleUpdate) (*InternalArticle, error)
Update updates an internal article by ID.
type MessageCreate ¶
type MessageCreate = gen.CreateMessageJSONRequestBody
MessageCreate holds the fields for creating a message.
type MessagesService ¶
type MessagesService struct {
// contains filtered or unexported fields
}
MessagesService exposes message-related Intercom API operations.
func (*MessagesService) Create ¶
func (s *MessagesService) Create(ctx context.Context, message MessageCreate) (*Message, error)
Create creates a message.
type NewsCursorPages ¶
type NewsCursorPages = gen.CursorPagesSchema
NewsCursorPages holds pagination details for a paginated news response.
type NewsItemCreate ¶
type NewsItemCreate = gen.NewsItemRequestSchema
NewsItemCreate holds the fields for creating a news item.
type NewsItemList ¶
type NewsItemList struct {
Data *[]NewsItem `json:"data,omitempty"`
Pages *NewsCursorPages `json:"pages,omitempty"`
TotalCount *int `json:"total_count,omitempty"`
Type *NewsListType `json:"type,omitempty"`
}
NewsItemList is a paginated list of Intercom news items.
type NewsItemUpdate ¶
type NewsItemUpdate = gen.NewsItemRequestSchema
NewsItemUpdate holds the fields for updating a news item.
type NewsListType ¶
type NewsListType = gen.PaginatedResponseType
NewsListType identifies the type of a paginated news response.
type NewsService ¶
type NewsService struct {
// contains filtered or unexported fields
}
NewsService exposes news-related Intercom API operations.
func (*NewsService) CreateItem ¶
func (s *NewsService) CreateItem(ctx context.Context, item NewsItemCreate) (*NewsItem, error)
CreateItem creates a news item.
func (*NewsService) DeleteItem ¶
func (s *NewsService) DeleteItem(ctx context.Context, newsItemID string) error
DeleteItem deletes a news item by ID.
func (*NewsService) ListFeedItems ¶
func (s *NewsService) ListFeedItems(ctx context.Context, newsfeedID string) (*NewsItemList, error)
ListFeedItems returns live items for a newsfeed.
func (*NewsService) ListFeeds ¶
func (s *NewsService) ListFeeds(ctx context.Context) (*NewsfeedList, error)
ListFeeds returns all newsfeeds.
func (*NewsService) ListItems ¶
func (s *NewsService) ListItems(ctx context.Context) (*NewsItemList, error)
ListItems returns all news items.
func (*NewsService) RetrieveFeed ¶
RetrieveFeed returns a newsfeed by ID.
func (*NewsService) RetrieveItem ¶
RetrieveItem returns a news item by ID.
func (*NewsService) UpdateItem ¶
func (s *NewsService) UpdateItem(ctx context.Context, newsItemID string, item NewsItemUpdate) (*NewsItem, error)
UpdateItem updates a news item by ID.
type NewsfeedList ¶
type NewsfeedList struct {
Data *[]Newsfeed `json:"data,omitempty"`
Pages *NewsCursorPages `json:"pages,omitempty"`
TotalCount *int `json:"total_count,omitempty"`
Type *NewsListType `json:"type,omitempty"`
}
NewsfeedList is a paginated list of Intercom newsfeeds.
type NotesService ¶
type NotesService struct {
// contains filtered or unexported fields
}
NotesService exposes note-related Intercom API operations.
type Option ¶
Option configures a Client.
func WithAPIVersion ¶
WithAPIVersion configures the Intercom-Version header.
func WithBaseURL ¶
WithBaseURL configures a custom API base URL.
func WithHTTPClient ¶
WithHTTPClient configures the HTTP client used to send requests.
func WithRegion ¶
WithRegion configures the Intercom API region.
func WithResponseHook ¶ added in v0.1.4
func WithResponseHook(hook ResponseHook) Option
WithResponseHook calls hook after the client receives an HTTP response or transport error.
func WithRetry ¶ added in v0.1.3
func WithRetry(config RetryConfig) Option
WithRetry enables opt-in retry handling for transient failures and rate limits.
func WithUserAgent ¶
WithUserAgent configures the User-Agent header.
type PageInfo ¶
type PageInfo struct {
Type string `json:"type,omitempty"`
Page int `json:"page,omitempty"`
PerPage int `json:"per_page,omitempty"`
TotalPages int `json:"total_pages,omitempty"`
Next *StartingAfterPage `json:"next,omitempty"`
}
PageInfo describes cursor pagination metadata returned by many Intercom list endpoints.
type PageOptions ¶ added in v0.1.2
PageOptions controls page-number pagination for endpoints that use page and per_page query parameters.
type PhoneSwitch ¶
type PhoneSwitch = gen.PhoneSwitchSchema
PhoneSwitch is an Intercom phone switch response.
type PhoneSwitchCreate ¶
type PhoneSwitchCreate = gen.CreatePhoneSwitchRequestSchema
PhoneSwitchCreate holds the fields for creating a phone switch.
type PhoneSwitchesService ¶
type PhoneSwitchesService struct {
// contains filtered or unexported fields
}
PhoneSwitchesService exposes phone-switch-related Intercom API operations.
func (*PhoneSwitchesService) Create ¶
func (s *PhoneSwitchesService) Create(ctx context.Context, req PhoneSwitchCreate) (*PhoneSwitch, error)
Create creates a phone switch.
type RegisterFinVoiceCallRequest ¶
type RegisterFinVoiceCallRequest = gen.RegisterFinVoiceCallRequestSchema
RegisterFinVoiceCallRequest holds the fields for registering a Fin Voice call.
type ReportingDataset ¶
type ReportingDataset struct {
Attributes *[]ReportingDatasetAttribute `json:"attributes,omitempty"`
DefaultTimeAttributeID *string `json:"default_time_attribute_id,omitempty"`
Description *string `json:"description,omitempty"`
ID *string `json:"id,omitempty"`
Name *string `json:"name,omitempty"`
}
ReportingDataset is a reporting dataset.
type ReportingDatasetAttribute ¶
type ReportingDatasetAttribute struct {
ID *string `json:"id,omitempty"`
Name *string `json:"name,omitempty"`
}
ReportingDatasetAttribute is a reporting dataset attribute.
type ReportingDatasetList ¶
type ReportingDatasetList struct {
Data *[]ReportingDataset `json:"data,omitempty"`
Type *string `json:"type,omitempty"`
}
ReportingDatasetList is a list of reporting datasets.
type ReportingExportCreate ¶
type ReportingExportCreate = gen.PostExportReportingDataEnqueueJSONBody
ReportingExportCreate holds the fields for creating a reporting export job.
type ReportingExportJob ¶
type ReportingExportJob struct {
DownloadExpiresAt *string `json:"download_expires_at,omitempty"`
DownloadURL *string `json:"download_url,omitempty"`
JobIdentifier *string `json:"job_identifier,omitempty"`
Status *string `json:"status,omitempty"`
}
ReportingExportJob is a reporting export job.
type ResponseHook ¶ added in v0.1.4
type ResponseHook func(ResponseInfo)
ResponseHook observes metadata for each HTTP response and transport error without changing service method signatures. When retries are enabled, it is called for every attempt.
type ResponseInfo ¶ added in v0.1.4
type ResponseInfo struct {
// StatusCode is the HTTP response status code. It is zero when no response was received.
StatusCode int
// RequestID is Intercom's X-Request-Id response header.
RequestID string
// RateLimitLimit is Intercom's X-RateLimit-Limit response header.
RateLimitLimit string
// RateLimitRemaining is Intercom's X-RateLimit-Remaining response header.
RateLimitRemaining string
// RateLimitReset is Intercom's X-RateLimit-Reset response header.
RateLimitReset string
// RetryAfter is the standard Retry-After response header.
RetryAfter string
// Duration is the time spent waiting for the HTTP transport.
Duration time.Duration
// Headers is a copy of the received response headers. It is nil when no response was received.
Headers http.Header
// Err is the transport error returned for the response attempt.
Err error
}
ResponseInfo describes an HTTP response or transport error observed by a ResponseHook.
type RetryConfig ¶ added in v0.1.3
type RetryConfig struct {
// MaxAttempts is the total number of attempts, including the first request. Defaults to 3.
MaxAttempts int
// InitialBackoff is the first exponential backoff delay when no Retry-After hint exists. Defaults to 100ms.
InitialBackoff time.Duration
// MaxBackoff caps exponential backoff delays when no Retry-After hint exists. Defaults to 2s.
MaxBackoff time.Duration
// Jitter applies +/- this fraction to exponential backoff delays. Defaults to 0.2.
Jitter float64
// AllowUnsafeMethods allows retries for mutating methods such as POST, PUT, PATCH, and DELETE.
AllowUnsafeMethods bool
// StatusCodes overrides the HTTP status codes retried by the policy. Defaults to 429, 500, 502, 503, and 504.
StatusCodes []int
}
RetryConfig controls opt-in retry behavior for transient failures and rate limits.
type SearchPagination ¶ added in v0.1.2
type SearchPagination = gen.StartingAfterPagingSchema
SearchPagination controls cursor pagination in Intercom search request bodies.
func NewSearchPagination ¶ added in v0.1.2
func NewSearchPagination(options CursorPageOptions) *SearchPagination
NewSearchPagination converts cursor options into a search request pagination body.
type SegmentList ¶
type SegmentList = gen.SegmentListSchema
SegmentList is a list of Intercom segments.
type SegmentsService ¶
type SegmentsService struct {
// contains filtered or unexported fields
}
SegmentsService exposes segment-related Intercom API operations.
func (*SegmentsService) List ¶
func (s *SegmentsService) List(ctx context.Context) (*SegmentList, error)
List returns all segments for the workspace.
type StartingAfterPage ¶
type StartingAfterPage struct {
PerPage int `json:"per_page,omitempty"`
StartingAfter string `json:"starting_after,omitempty"`
}
StartingAfterPage describes the next cursor page in Intercom responses.
type SubscriptionType ¶
type SubscriptionType = gen.SubscriptionTypeSchema
SubscriptionType is an Intercom subscription type.
type SubscriptionTypeList ¶
type SubscriptionTypeList = gen.SubscriptionTypeListSchema
SubscriptionTypeList is a list of subscription types.
type SubscriptionTypesService ¶
type SubscriptionTypesService struct {
// contains filtered or unexported fields
}
SubscriptionTypesService exposes subscription-type-related Intercom API operations.
func (*SubscriptionTypesService) List ¶
func (s *SubscriptionTypesService) List(ctx context.Context) (*SubscriptionTypeList, error)
List returns all subscription types for the workspace.
type TagCompanyReference ¶
type TagCompanyReference struct {
CompanyID *string `json:"company_id,omitempty"`
ID *string `json:"id,omitempty"`
}
TagCompanyReference identifies a company in a tag company request.
type TagCompanyRequest ¶
type TagCompanyRequest struct {
Companies []TagCompanyReference `json:"companies"`
Name string `json:"name"`
}
TagCompanyRequest tags one or more companies with a tag name.
type TagCompanyUntagReference ¶
type TagCompanyUntagReference struct {
CompanyID *string `json:"company_id,omitempty"`
ID *string `json:"id,omitempty"`
Untag bool `json:"untag"`
}
TagCompanyUntagReference identifies a company to untag.
type TagCompanyUntagRequest ¶
type TagCompanyUntagRequest struct {
Companies []TagCompanyUntagReference `json:"companies"`
Name string `json:"name"`
}
TagCompanyUntagRequest removes a tag from one or more companies.
func (TagCompanyUntagRequest) MarshalJSON ¶
func (r TagCompanyUntagRequest) MarshalJSON() ([]byte, error)
MarshalJSON ensures Intercom's required `untag: true` flag is always present.
type TagCreateOrUpdateRequest ¶
TagCreateOrUpdateRequest creates a new tag or renames an existing one.
type TagCreateRequest ¶
type TagCreateRequest interface {
// contains filtered or unexported methods
}
TagCreateRequest is a supported request body for the tag create/update endpoint.
type TagDetail ¶
type TagDetail = gen.TagBasicSchema
TagDetail is a single Intercom tag returned by the tag lookup endpoint.
type TagUserReference ¶
type TagUserReference struct {
ID string `json:"id"`
}
TagUserReference identifies a contact in a tag users request.
type TagUsersRequest ¶
type TagUsersRequest struct {
Name string `json:"name"`
Users []TagUserReference `json:"users"`
}
TagUsersRequest tags one or more contacts with a tag name.
type TagsService ¶
type TagsService struct {
// contains filtered or unexported fields
}
TagsService exposes tag-related Intercom API operations.
func (*TagsService) Create ¶
func (s *TagsService) Create(ctx context.Context, req TagCreateRequest) (*TagDetail, error)
Create creates or updates a tag, or applies tag operations supported by the endpoint.
func (*TagsService) Delete ¶
func (s *TagsService) Delete(ctx context.Context, tagID string) error
Delete deletes a tag by ID.
type TeamsService ¶
type TeamsService struct {
// contains filtered or unexported fields
}
TeamsService exposes team-related Intercom API operations.
type TicketAdminReply ¶
type TicketAdminReply struct {
AdminID string `json:"admin_id"`
AttachmentURLs *[]string `json:"attachment_urls,omitempty"`
Body *string `json:"body,omitempty"`
CreatedAt *int `json:"created_at,omitempty"`
CrossPost *bool `json:"cross_post,omitempty"`
MessageType TicketReplyMessageType `json:"message_type"`
ReplyOptions *[]TicketReplyOption `json:"reply_options,omitempty"`
}
TicketAdminReply replies to a ticket on behalf of an admin.
type TicketContact ¶
type TicketContact = gen.CreateTicketRequest_Contacts_Item
TicketContact is a contact selector included in a ticket create request.
func NewTicketContactByEmail ¶
func NewTicketContactByEmail(email string) TicketContact
NewTicketContactByEmail constructs a ticket contact selector from a contact email.
func NewTicketContactByExternalID ¶
func NewTicketContactByExternalID(externalID string) TicketContact
NewTicketContactByExternalID constructs a ticket contact selector from an external contact ID.
func NewTicketContactByID ¶
func NewTicketContactByID(id string) TicketContact
NewTicketContactByID constructs a ticket contact selector from an Intercom contact ID.
type TicketContactEmail ¶
type TicketContactEmail = gen.CreateTicketRequestContacts2
TicketContactEmail selects a ticket contact by email address.
type TicketContactExternalID ¶
type TicketContactExternalID = gen.CreateTicketRequestContacts1
TicketContactExternalID selects a ticket contact by external ID.
type TicketContactID ¶
type TicketContactID = gen.CreateTicketRequestContacts0
TicketContactID selects a ticket contact by Intercom contact ID.
type TicketContactReply ¶
type TicketContactReply struct {
AttachmentURLs *[]string `json:"attachment_urls,omitempty"`
Body string `json:"body"`
Contact TicketReplyContact `json:"-"`
CreatedAt *int `json:"created_at,omitempty"`
ReplyOptions *[]TicketReplyOption `json:"reply_options,omitempty"`
}
TicketContactReply replies to a ticket on behalf of a contact.
type TicketCreate ¶
type TicketCreate = gen.CreateTicketJSONBody
TicketCreate holds the fields for creating a ticket.
type TicketEnqueued ¶
type TicketEnqueued = gen.JobsSchema
TicketEnqueued is an async ticket creation job.
type TicketIterator ¶ added in v0.1.3
type TicketIterator struct {
// contains filtered or unexported fields
}
TicketIterator lazily iterates over ticket search results.
func (*TicketIterator) Err ¶ added in v0.1.3
func (i *TicketIterator) Err() error
Err returns the first error encountered while fetching pages.
func (*TicketIterator) Next ¶ added in v0.1.3
func (i *TicketIterator) Next() bool
Next advances the iterator to the next ticket.
func (*TicketIterator) Ticket ¶ added in v0.1.3
func (i *TicketIterator) Ticket() *Ticket
Ticket returns the current ticket. It returns nil before the first successful Next call.
type TicketReply ¶
type TicketReply = gen.TicketReplySchema
TicketReply is the result of replying to a ticket.
type TicketReplyContact ¶
type TicketReplyContact struct {
Email *string `json:"email,omitempty"`
IntercomUserID *string `json:"intercom_user_id,omitempty"`
UserID *string `json:"user_id,omitempty"`
}
TicketReplyContact identifies the contact replying to a ticket.
func NewTicketReplyContactByEmail ¶
func NewTicketReplyContactByEmail(email string) TicketReplyContact
NewTicketReplyContactByEmail constructs a ticket reply contact selector from an email address.
func NewTicketReplyContactByIntercomUserID ¶
func NewTicketReplyContactByIntercomUserID(intercomUserID string) TicketReplyContact
NewTicketReplyContactByIntercomUserID constructs a ticket reply contact selector from an Intercom contact ID.
func NewTicketReplyContactByUserID ¶
func NewTicketReplyContactByUserID(userID string) TicketReplyContact
NewTicketReplyContactByUserID constructs a ticket reply contact selector from an external user ID.
type TicketReplyMessageType ¶
type TicketReplyMessageType string
TicketReplyMessageType identifies the kind of reply sent to a ticket.
const ( // TicketReplyMessageTypeComment posts a visible comment reply to the ticket. TicketReplyMessageTypeComment TicketReplyMessageType = "comment" // TicketReplyMessageTypeNote posts an internal note on the ticket. TicketReplyMessageTypeNote TicketReplyMessageType = "note" // TicketReplyMessageTypeQuickReply posts a reply that includes quick-reply options. TicketReplyMessageTypeQuickReply TicketReplyMessageType = "quick_reply" )
type TicketReplyOption ¶
TicketReplyOption is a quick-reply option included in a ticket reply.
type TicketReplyRequest ¶
type TicketReplyRequest interface {
// contains filtered or unexported methods
}
TicketReplyRequest is a supported request body for the ticket reply endpoint.
type TicketSearchQuery ¶
type TicketSearchQuery = gen.SearchRequestSchema
TicketSearchQuery holds the query for searching tickets.
type TicketState ¶
type TicketState = gen.TicketStateDetailedSchema
TicketState is an Intercom ticket state.
type TicketStateList ¶
type TicketStateList = gen.TicketStateListSchema
TicketStateList is a list of ticket states.
type TicketTagAttachRequest ¶
type TicketTagAttachRequest = gen.AttachTagToTicketJSONBody
TicketTagAttachRequest holds the fields for attaching a tag to a ticket.
type TicketTagDetachRequest ¶
type TicketTagDetachRequest = gen.DetachTagFromTicketJSONBody
TicketTagDetachRequest holds the fields for detaching a tag from a ticket.
type TicketTypeAttribute ¶
type TicketTypeAttribute = gen.TicketTypeAttributeSchema
TicketTypeAttribute is an Intercom ticket type attribute.
type TicketTypeAttributeCreate ¶
type TicketTypeAttributeCreate = gen.CreateTicketTypeAttributeRequestSchema
TicketTypeAttributeCreate holds the fields for creating a ticket type attribute.
type TicketTypeAttributeUpdate ¶
type TicketTypeAttributeUpdate = gen.UpdateTicketTypeAttributeRequestSchema
TicketTypeAttributeUpdate holds the fields for updating a ticket type attribute.
type TicketTypeCreate ¶
type TicketTypeCreate = gen.CreateTicketTypeRequestSchema
TicketTypeCreate holds the fields for creating a ticket type.
type TicketTypeList ¶
type TicketTypeList = gen.TicketTypeListSchema
TicketTypeList is a list of ticket types.
type TicketTypeUpdate ¶
type TicketTypeUpdate = gen.UpdateTicketTypeRequestSchema
TicketTypeUpdate holds the fields for updating a ticket type.
type TicketUpdate ¶
type TicketUpdate = gen.UpdateTicketJSONBody
TicketUpdate holds the fields for updating a ticket.
type TicketsService ¶
type TicketsService struct {
// contains filtered or unexported fields
}
TicketsService exposes ticket-related Intercom API operations.
func (*TicketsService) AttachTag ¶
func (s *TicketsService) AttachTag(ctx context.Context, ticketID string, req TicketTagAttachRequest) (*Tag, error)
AttachTag attaches a tag to a ticket.
func (*TicketsService) Create ¶
func (s *TicketsService) Create(ctx context.Context, ticket TicketCreate) (*Ticket, error)
Create creates a ticket.
func (*TicketsService) CreateType ¶
func (s *TicketsService) CreateType(ctx context.Context, ticketType TicketTypeCreate) (*TicketType, error)
CreateType creates a ticket type.
func (*TicketsService) CreateTypeAttribute ¶
func (s *TicketsService) CreateTypeAttribute(ctx context.Context, ticketTypeID string, attribute TicketTypeAttributeCreate) (*TicketTypeAttribute, error)
CreateTypeAttribute creates an attribute for a ticket type.
func (*TicketsService) Delete ¶
func (s *TicketsService) Delete(ctx context.Context, ticketID string) error
Delete deletes a ticket by ID.
func (*TicketsService) DetachTag ¶
func (s *TicketsService) DetachTag(ctx context.Context, ticketID, tagID string, req TicketTagDetachRequest) (*Tag, error)
DetachTag detaches a tag from a ticket.
func (*TicketsService) EnqueueCreate ¶
func (s *TicketsService) EnqueueCreate(ctx context.Context, ticket TicketCreate) (*TicketEnqueued, error)
EnqueueCreate enqueues asynchronous ticket creation.
func (*TicketsService) GetType ¶
func (s *TicketsService) GetType(ctx context.Context, ticketTypeID string) (*TicketType, error)
GetType retrieves a ticket type by ID.
func (*TicketsService) ListStates ¶
func (s *TicketsService) ListStates(ctx context.Context) (*TicketStateList, error)
ListStates returns all ticket states for the workspace.
func (*TicketsService) ListTypes ¶
func (s *TicketsService) ListTypes(ctx context.Context) (*TicketTypeList, error)
ListTypes returns all ticket types for the workspace.
func (*TicketsService) Reply ¶
func (s *TicketsService) Reply(ctx context.Context, ticketID string, req TicketReplyRequest, skipNotifications *bool) (*TicketReply, error)
Reply replies to a ticket.
func (*TicketsService) Search ¶
func (s *TicketsService) Search(ctx context.Context, query TicketSearchQuery) (*TicketList, error)
Search searches tickets using an Intercom search query.
func (*TicketsService) SearchIter ¶ added in v0.1.3
func (s *TicketsService) SearchIter(ctx context.Context, query TicketSearchQuery, options CursorPageOptions) *TicketIterator
SearchIter returns a lazy iterator for ticket search results.
func (*TicketsService) SearchWithOptions ¶ added in v0.1.2
func (s *TicketsService) SearchWithOptions(ctx context.Context, query TicketSearchQuery, options CursorPageOptions) (*TicketList, error)
SearchWithOptions searches tickets using cursor pagination options.
func (*TicketsService) Update ¶
func (s *TicketsService) Update(ctx context.Context, ticketID string, ticket TicketUpdate) (*Ticket, error)
Update updates a ticket by ID.
func (*TicketsService) UpdateType ¶
func (s *TicketsService) UpdateType(ctx context.Context, ticketTypeID string, ticketType TicketTypeUpdate) (*TicketType, error)
UpdateType updates a ticket type by ID.
func (*TicketsService) UpdateTypeAttribute ¶
func (s *TicketsService) UpdateTypeAttribute(ctx context.Context, ticketTypeID, attributeID string, attribute TicketTypeAttributeUpdate) (*TicketTypeAttribute, error)
UpdateTypeAttribute updates an attribute for a ticket type.
type VisitorConvert ¶
type VisitorConvert struct {
Type string `json:"type"`
User VisitorConvertContact `json:"user"`
Visitor VisitorConvertSource `json:"visitor"`
}
VisitorConvert holds the fields for converting a visitor.
type VisitorConvertContact ¶
type VisitorConvertContact struct {
Email *string `json:"email,omitempty"`
ID *string `json:"id,omitempty"`
UserID *string `json:"user_id,omitempty"`
}
VisitorConvertContact identifies the contact retained after converting a visitor.
type VisitorConvertSource ¶
type VisitorConvertSource struct {
Email *string `json:"email,omitempty"`
ID *string `json:"id,omitempty"`
UserID *string `json:"user_id,omitempty"`
}
VisitorConvertSource identifies the visitor to convert.
type VisitorConverted ¶
type VisitorConverted = gen.ContactSchema
VisitorConverted is the contact returned after converting a visitor.
type VisitorUpdate ¶
type VisitorUpdate struct {
CustomAttributes *map[string]string `json:"custom_attributes,omitempty"`
ID *string `json:"id,omitempty"`
Name *string `json:"name,omitempty"`
UserID *string `json:"user_id,omitempty"`
}
VisitorUpdate holds the fields for updating a visitor.
type VisitorsService ¶
type VisitorsService struct {
// contains filtered or unexported fields
}
VisitorsService exposes visitor-related Intercom API operations.
func (*VisitorsService) Convert ¶
func (s *VisitorsService) Convert(ctx context.Context, req VisitorConvert) (*VisitorConverted, error)
Convert converts a visitor into a contact.
func (*VisitorsService) GetByUserID ¶
GetByUserID retrieves a visitor by user ID.
func (*VisitorsService) Update ¶
func (s *VisitorsService) Update(ctx context.Context, update VisitorUpdate) (*Visitor, error)
Update updates a visitor.
type WebhookEvent ¶ added in v0.1.2
type WebhookEvent struct {
Type string `json:"type"`
AppID string `json:"app_id"`
Data WebhookEventData `json:"data"`
Links map[string]any `json:"links,omitempty"`
ID string `json:"id"`
Topic string `json:"topic"`
DeliveryStatus string `json:"delivery_status"`
DeliveryAttempts int `json:"delivery_attempts"`
DeliveredAt int64 `json:"delivered_at"`
FirstSentAt int64 `json:"first_sent_at"`
CreatedAt int64 `json:"created_at"`
Self any `json:"self,omitempty"`
Raw json.RawMessage `json:"-"`
}
WebhookEvent is the common Intercom webhook notification envelope.
Topic identifies the event, for example "ticket.created". Data.Item contains the raw topic-specific Intercom object so callers can decode only the topics they handle while remaining forward-compatible with new topics.
func ParseWebhook ¶ added in v0.1.2
func ParseWebhook(r io.Reader) (*WebhookEvent, error)
ParseWebhook reads and parses an Intercom webhook notification.
If you need to verify a webhook signature, read the request body once, call VerifyWebhookSignature with the raw bytes, and then call ParseWebhookPayload with the same bytes. Do not verify a re-encoded JSON body.
func ParseWebhookPayload ¶ added in v0.1.2
func ParseWebhookPayload(payload []byte) (*WebhookEvent, error)
ParseWebhookPayload parses an Intercom webhook notification from raw bytes.
func (*WebhookEvent) DecodeItem ¶ added in v0.1.2
func (e *WebhookEvent) DecodeItem(v any) error
DecodeItem decodes the topic-specific webhook item into v.
type WebhookEventData ¶ added in v0.1.2
type WebhookEventData struct {
Type string `json:"type"`
Item json.RawMessage `json:"item"`
Raw json.RawMessage `json:"-"`
}
WebhookEventData is the common data envelope inside an Intercom webhook notification.
func (WebhookEventData) DecodeItem ¶ added in v0.1.2
func (d WebhookEventData) DecodeItem(v any) error
DecodeItem decodes the topic-specific webhook item into v.
type WorkflowExport ¶
type WorkflowExport = gen.WorkflowExportSchema
WorkflowExport is an exported workflow.
type WorkspaceService ¶
type WorkspaceService struct {
// contains filtered or unexported fields
}
WorkspaceService exposes workspace-level Intercom API operations.
func (*WorkspaceService) CancelDataExport ¶
func (s *WorkspaceService) CancelDataExport(ctx context.Context, jobIdentifier string) (*DataExport, error)
CancelDataExport cancels a content data export job.
func (*WorkspaceService) CreateDataExport ¶
func (s *WorkspaceService) CreateDataExport(ctx context.Context, req DataExportCreate) (*DataExport, error)
CreateDataExport creates a content data export job.
func (*WorkspaceService) CreateReportingExport ¶
func (s *WorkspaceService) CreateReportingExport(ctx context.Context, req ReportingExportCreate) (*ReportingExportJob, error)
CreateReportingExport creates a reporting export job.
func (*WorkspaceService) DownloadDataExport ¶
func (s *WorkspaceService) DownloadDataExport(ctx context.Context, jobIdentifier string) ([]byte, error)
DownloadDataExport downloads the raw content data export payload.
func (*WorkspaceService) DownloadReportingExport ¶
func (s *WorkspaceService) DownloadReportingExport(ctx context.Context, jobIdentifier, appID string) ([]byte, error)
DownloadReportingExport downloads the raw reporting export payload.
func (*WorkspaceService) ExportWorkflow ¶
func (s *WorkspaceService) ExportWorkflow(ctx context.Context, workflowID string) (*WorkflowExport, error)
ExportWorkflow exports a workflow by ID.
func (*WorkspaceService) GetDataExport ¶
func (s *WorkspaceService) GetDataExport(ctx context.Context, jobIdentifier string) (*DataExport, error)
GetDataExport retrieves a content data export job by identifier.
func (*WorkspaceService) GetIPAllowlist ¶
func (s *WorkspaceService) GetIPAllowlist(ctx context.Context) (*IPAllowlist, error)
GetIPAllowlist returns the workspace IP allowlist configuration.
func (*WorkspaceService) GetReportingExportJob ¶
func (s *WorkspaceService) GetReportingExportJob(ctx context.Context, jobIdentifier, appID, clientID string) (*ReportingExportJob, error)
GetReportingExportJob retrieves a reporting export job by identifier.
func (*WorkspaceService) ListReportingDatasets ¶
func (s *WorkspaceService) ListReportingDatasets(ctx context.Context) (*ReportingDatasetList, error)
ListReportingDatasets returns reporting datasets available for export.
func (*WorkspaceService) UpdateIPAllowlist ¶
func (s *WorkspaceService) UpdateIPAllowlist(ctx context.Context, allowlist IPAllowlist) (*IPAllowlist, error)
UpdateIPAllowlist updates the workspace IP allowlist configuration.
Source Files
¶
- admins.go
- ai_content.go
- articles.go
- away_status_reasons.go
- brands.go
- calls.go
- client.go
- collections.go
- companies.go
- contacts.go
- conversations.go
- custom_objects.go
- data_attributes.go
- data_events.go
- doc.go
- emails.go
- errors.go
- fin.go
- help_centers.go
- internal_articles.go
- iterators.go
- messages.go
- news.go
- notes.go
- options.go
- pagination.go
- phone_switches.go
- response.go
- response_info.go
- retry.go
- segments.go
- subscription_types.go
- tags.go
- teams.go
- tickets.go
- visitors.go
- webhooks.go
- workspace_services.go
Directories
¶
| Path | Synopsis |
|---|---|
|
examples
|
|
|
identify_admin
command
|
|
|
search_contacts
command
|
|
|
Package intercomtest provides offline test helpers for code using intercom-go.
|
Package intercomtest provides offline test helpers for code using intercom-go. |
|
internal
|
|
|
generated/intercom
Package intercom provides primitives to interact with the openapi HTTP API.
|
Package intercom provides primitives to interact with the openapi HTTP API. |
|
tools/normalize-spec
command
|
|
|
tools/spec-diff
command
|
|
|
tools/update-spec
command
|