Documentation
¶
Index ¶
- type AddLabelsRequest
- type ChatwootClient
- func (client *ChatwootClient) AddLabel(accountId int64, conversationId int64, agentToken string, label string) error
- func (client *ChatwootClient) AddLabels(accountId int64, conversationId int64, agentToken string, labels []string) error
- func (client *ChatwootClient) Assign(accountId int64, conversationId int64, agentToken string, assignee_id int) error
- func (client *ChatwootClient) AssignTeam(accountId int64, conversationId int64, agentToken string, team_id int) error
- func (client *ChatwootClient) CreateContact(accountId int64, agentToken string, createContactRequest CreateContactRequest) (CreateContactResponse, error)
- func (client *ChatwootClient) CreateIncomingMessage(accountId int64, conversationId int64, agentBotToken string, content string) (CreateNewMessageResponse, error)
- func (client *ChatwootClient) CreateIncomingPrivateMessage(accountId int64, conversationId int64, agentBotToken string, content string) (CreateNewMessageResponse, error)
- func (client *ChatwootClient) CreateNewConversation(accountId int64, agentBotToken string, ...) (CreateNewConversationResponse, error)
- func (client *ChatwootClient) CreateNewMessage(accountId int64, conversationId int64, agentBotToken string, ...) (CreateNewMessageResponse, error)
- func (client *ChatwootClient) CreateOutgoingMessage(accountId int64, conversationId int64, agentBotToken string, content string) (CreateNewMessageResponse, error)
- func (client *ChatwootClient) CreateOutgoingPrivateMessage(accountId int64, conversationId int64, agentBotToken string, content string) (CreateNewMessageResponse, error)
- func (client *ChatwootClient) GetMessages(accountId int64, conversationId int64, agentToken string) (ChatwootMessages, error)
- func (client *ChatwootClient) ReadConversationMessage(accountId int64, conversationId int64, agentToken string, isBroadRead bool) error
- func (client *ChatwootClient) SendConversationTips(accountId int64, conversationId int64, agentToken string, gptStatus string) error
- func (client *ChatwootClient) SendImageMessage(accountId int64, conversationId int64, agentBotToken string, imageUrl string, ...) (CreateNewMessageResponse, error)
- func (client *ChatwootClient) SendNotification(accountId int64, agentToken string, args SendNotificationRequest) error
- func (client *ChatwootClient) UpdateConversationAIDisabled(accountId int64, conversationId int64, agentToken string, aiDisabled bool) error
- type ChatwootMessages
- type Contact
- type ContactInbox
- type CreateContactRequest
- type CreateContactResponse
- type CreateNewConversationRequest
- type CreateNewConversationResponse
- type CreateNewMessageRequest
- type CreateNewMessageResponse
- type GetMessagesResponse
- type Payload
- type ReadConversationMessageRequest
- type SendConversationTipsRequest
- type SendNotificationRequest
- type UpdateConversationAIDisabledRequest
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AddLabelsRequest ¶
type AddLabelsRequest struct {
Labels []string `json:"labels"`
}
type ChatwootClient ¶
type ChatwootClient struct {
BaseUrl string
}
Please note that certain functions like to add labels or assign agents are blocked when using an Agent Bot Token therefore an AgentToken has to be provided. The client uses the AgentBotToken wherever possible.
func NewChatwootClient ¶
func NewChatwootClient(baseUrl string) ChatwootClient
func NewChatwootClientWithAgentToken ¶
func NewChatwootClientWithAgentToken(baseUrl string) ChatwootClient
func (*ChatwootClient) AssignTeam ¶
func (*ChatwootClient) CreateContact ¶
func (client *ChatwootClient) CreateContact(accountId int64, agentToken string, createContactRequest CreateContactRequest) (CreateContactResponse, error)
func (*ChatwootClient) CreateIncomingMessage ¶
func (client *ChatwootClient) CreateIncomingMessage(accountId int64, conversationId int64, agentBotToken string, content string) (CreateNewMessageResponse, error)
func (*ChatwootClient) CreateIncomingPrivateMessage ¶
func (client *ChatwootClient) CreateIncomingPrivateMessage(accountId int64, conversationId int64, agentBotToken string, content string) (CreateNewMessageResponse, error)
func (*ChatwootClient) CreateNewConversation ¶
func (client *ChatwootClient) CreateNewConversation(accountId int64, agentBotToken string, createNewConversationRequest CreateNewConversationRequest) (CreateNewConversationResponse, error)
func (*ChatwootClient) CreateNewMessage ¶
func (client *ChatwootClient) CreateNewMessage(accountId int64, conversationId int64, agentBotToken string, createMessageRequest CreateNewMessageRequest) (CreateNewMessageResponse, error)
func (*ChatwootClient) CreateOutgoingMessage ¶
func (client *ChatwootClient) CreateOutgoingMessage(accountId int64, conversationId int64, agentBotToken string, content string) (CreateNewMessageResponse, error)
func (*ChatwootClient) CreateOutgoingPrivateMessage ¶
func (client *ChatwootClient) CreateOutgoingPrivateMessage(accountId int64, conversationId int64, agentBotToken string, content string) (CreateNewMessageResponse, error)
func (*ChatwootClient) GetMessages ¶
func (client *ChatwootClient) GetMessages(accountId int64, conversationId int64, agentToken string) (ChatwootMessages, error)
func (*ChatwootClient) ReadConversationMessage ¶
func (client *ChatwootClient) ReadConversationMessage(accountId int64, conversationId int64, agentToken string, isBroadRead bool) error
*
- 修改会话的ai状态
func (*ChatwootClient) SendConversationTips ¶
func (client *ChatwootClient) SendConversationTips(accountId int64, conversationId int64, agentToken string, gptStatus string) error
*
- 发送通知
func (*ChatwootClient) SendImageMessage ¶
func (client *ChatwootClient) SendImageMessage( accountId int64, conversationId int64, agentBotToken string, imageUrl string, content string, ) (CreateNewMessageResponse, error)
func (*ChatwootClient) SendNotification ¶
func (client *ChatwootClient) SendNotification(accountId int64, agentToken string, args SendNotificationRequest) error
*
- 发送通知
func (*ChatwootClient) UpdateConversationAIDisabled ¶
func (client *ChatwootClient) UpdateConversationAIDisabled(accountId int64, conversationId int64, agentToken string, aiDisabled bool) error
*
- 修改会话的ai状态
type ChatwootMessages ¶
type Contact ¶
type Contact struct { ID int `json:"id"` ContactInboxes []ContactInbox `json:"contact_inboxes"` }
type ContactInbox ¶
type ContactInbox struct {
SourceID string `json:"source_id"`
}
type CreateContactRequest ¶
type CreateContactRequest struct { InboxID int `json:"inbox_id"` Name string `json:"name,omitempty"` EMail string `json:"email,omitempty"` PhoneNumber string `json:"phone_number,omitempty"` Avatar string `json:"avatar,omitempty"` AvatarUrl string `json:"avatar_url,omitempty"` Identifier string `json:"identifier,omitempty"` CustomAttributes interface{} `json:"custom_attributes,omitempty"` }
type CreateContactResponse ¶
type CreateContactResponse struct {
Payload Payload `json:"payload"`
}
type CreateNewMessageRequest ¶
type CreateNewMessageRequest struct { Content string `json:"content"` MessageType string `json:"message_type"` Private bool `json:"private"` }
Struct that allows to build minimal create message requests.
func NewCreateNewMessageRequest ¶
func NewCreateNewMessageRequest(content string, messageType string, private bool) CreateNewMessageRequest
type GetMessagesResponse ¶
type GetMessagesResponse struct { Meta interface{} `json:"meta"` Payload ChatwootMessages `json:"payload"` }
type ReadConversationMessageRequest ¶
type ReadConversationMessageRequest struct {
IsBroadRead bool `json:"isBroadRead"`
}
type SendConversationTipsRequest ¶
type SendConversationTipsRequest struct {
GptStatus string `json:"gpt_status"`
}
type SendNotificationRequest ¶
type UpdateConversationAIDisabledRequest ¶
type UpdateConversationAIDisabledRequest struct {
AIDisabled bool `json:"ai_disabled"`
}
Click to show internal directories.
Click to hide internal directories.