Documentation ¶
Index ¶
- func MessageTypeString(messageType MessageType) string
- type Attachment
- type ChatwootAPI
- func (api *ChatwootAPI) AddConversationLabel(conversationID int, labels []string) error
- func (api *ChatwootAPI) ContactIDForMxid(userID mid.UserID) (int, error)
- func (api *ChatwootAPI) CreateContact(userID mid.UserID) (int, error)
- func (api *ChatwootAPI) CreateConversation(sourceID string, contactID int, additionalAttrs map[string]string) (*Conversation, error)
- func (api *ChatwootAPI) DeleteMessage(conversationID int, messageID int) error
- func (api *ChatwootAPI) DoRequest(req *http.Request) (*http.Response, error)
- func (api *ChatwootAPI) DownloadAttachment(url string) ([]byte, error)
- func (api *ChatwootAPI) GetChatwootConversation(conversationID int) (*Conversation, error)
- func (api *ChatwootAPI) MakeUri(endpoint string) string
- func (api *ChatwootAPI) SendAttachmentMessage(conversationID int, filename string, mimeType string, fileData io.Reader, ...) (*Message, error)
- func (api *ChatwootAPI) SendPrivateMessage(conversationID int, content string) (*Message, error)
- func (api *ChatwootAPI) SendTextMessage(conversationID int, content string, messageType MessageType) (*Message, error)
- func (api *ChatwootAPI) SetConversationCustomAttributes(conversationID int, customAttrs map[string]string) error
- type Contact
- type ContactPayload
- type ContactPayloadInner
- type ContactsPayload
- type ContentAttributes
- type Conversation
- type ConversationMeta
- type ConversationStatusChanged
- type ConversationsPayload
- type CreateContactPayload
- type Message
- type MessageCreated
- type MessageType
- type Sender
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func MessageTypeString ¶
func MessageTypeString(messageType MessageType) string
Types ¶
type Attachment ¶
type ChatwootAPI ¶
type ChatwootAPI struct { BaseURL string AccountID int InboxID int AccessToken string Client *http.Client }
func CreateChatwootAPI ¶
func CreateChatwootAPI(baseURL string, accountID int, inboxID int, accessToken string) *ChatwootAPI
func (*ChatwootAPI) AddConversationLabel ¶
func (api *ChatwootAPI) AddConversationLabel(conversationID int, labels []string) error
func (*ChatwootAPI) ContactIDForMxid ¶
func (api *ChatwootAPI) ContactIDForMxid(userID mid.UserID) (int, error)
func (*ChatwootAPI) CreateContact ¶
func (api *ChatwootAPI) CreateContact(userID mid.UserID) (int, error)
func (*ChatwootAPI) CreateConversation ¶
func (api *ChatwootAPI) CreateConversation(sourceID string, contactID int, additionalAttrs map[string]string) (*Conversation, error)
func (*ChatwootAPI) DeleteMessage ¶
func (api *ChatwootAPI) DeleteMessage(conversationID int, messageID int) error
func (*ChatwootAPI) DownloadAttachment ¶
func (api *ChatwootAPI) DownloadAttachment(url string) ([]byte, error)
func (*ChatwootAPI) GetChatwootConversation ¶
func (api *ChatwootAPI) GetChatwootConversation(conversationID int) (*Conversation, error)
func (*ChatwootAPI) MakeUri ¶
func (api *ChatwootAPI) MakeUri(endpoint string) string
func (*ChatwootAPI) SendAttachmentMessage ¶
func (api *ChatwootAPI) SendAttachmentMessage(conversationID int, filename string, mimeType string, fileData io.Reader, messageType MessageType) (*Message, error)
func (*ChatwootAPI) SendPrivateMessage ¶
func (api *ChatwootAPI) SendPrivateMessage(conversationID int, content string) (*Message, error)
func (*ChatwootAPI) SendTextMessage ¶
func (api *ChatwootAPI) SendTextMessage(conversationID int, content string, messageType MessageType) (*Message, error)
func (*ChatwootAPI) SetConversationCustomAttributes ¶
func (api *ChatwootAPI) SetConversationCustomAttributes(conversationID int, customAttrs map[string]string) error
type Contact ¶
type Contact struct { ID int `json:"id"` Email string `json:"email"` Identifier string `json:"identifier"` }
Contact
type ContactPayload ¶
type ContactPayload struct {
Payload ContactPayloadInner `json:"payload"`
}
type ContactPayloadInner ¶
type ContactPayloadInner struct {
Contact Contact `json:"contact"`
}
type ContactsPayload ¶
type ContactsPayload struct {
Payload []Contact `json:"payload"`
}
type ContentAttributes ¶
type ContentAttributes struct {
Deleted bool `json:"deleted"`
}
type Conversation ¶
type ConversationMeta ¶
type ConversationMeta struct {
Sender Contact `json:"sender"`
}
type ConversationsPayload ¶
type ConversationsPayload struct {
Payload []Conversation `json:"payload"`
}
type CreateContactPayload ¶
type Message ¶
type Message struct { ID int `json:"id"` Content *string `json:"content"` Private bool `json:"private"` Attachments []Attachment `json:"attachments"` Sender Sender `json:"sender"` }
type MessageCreated ¶
type MessageCreated struct { ID int `json:"id"` Content string `json:"content"` CreatedAt string `json:"created_at"` MessageType string `json:"message_type"` ContentType string `json:"content_type"` ContentAttributes *ContentAttributes `json:"content_attributes"` Private bool `json:"private"` Conversation Conversation `json:"conversation"` }
type MessageType ¶
type MessageType int
const ( IncomingMessage MessageType = iota OutgoingMessage )
Click to show internal directories.
Click to hide internal directories.