customer-android-kotlin

//core/com.kustomer.core.providers/KusChatProvider/sendMessageWithAttachments

sendMessageWithAttachments

[androidJvm]
abstract suspend fun sendMessageWithAttachments(body: String?, messageAction: KusMessageAction?, attachments: List<KusUploadAttachment>?, conversationId: String, isFirstMessage: Boolean = false, lastDeflectionData: KusKbLastDeflectionData? = null, initialAgentMessages: List<String>? = null, assistantId: String? = null): KusResult<KusChatMessage>

Sends message along with attachment to a conversation. Total attachment size allowed with a single message is 9MB. Maximum allowed size per attachment is 5MB.

Returns KusResult.Error if both message and attachments parameter are null.

Note: This is a suspend function and should be called from Kotlin Coroutines

Return

KusResult of type KusChatMessage

See also

androidJvm

   
com.kustomer.core.models.chat.KusUploadAttachment  
com.kustomer.core.models.chat.KusKbLastDeflectionData  

Parameters

androidJvm

   
body Optional text message
messageAction Optional field. This field should only be used for Chat assistant’s KusMessageTemplateType.QUICK_REPLY messages containing KusMessageAction. Pass in the selected KusMessageAction parameter from Quick replies for this field.
attachments List of KusUploadAttachment within the allowed size limits
conversationId of the KusConversation to send message
isFirstMessage should be true if it is the first customer sent message in a conversation. This is primarily used for chat assistant created conversations
lastDeflectionData contains the KusKbLastDeflectionData which is referred when sending back details about the kb deflect articles sent via chat assistant
initialAgentMessages A list of messages that appear to the end user as if they were sent at the beginning of a conversation by an agent or bot. Ignored if a Chat Assistant is set.
assistantId optional assistantId for sending assistant reply messages. If not provided, the default one is used in the KusChatSetting.assistantId. In case of no assistant preferences, simply sends a normal reply instead.