Skip to main content

Put Multimedia

The LikeMinds React Chat SDK provides the Put Multimedia feature, allowing you to attach multimedia files to your conversations effortlessly. By utilizing this feature, you can enrich your conversations with various types of media, such as images, videos, documents, and more.

Steps to Put Multimedia in a Conversation

  1. Upload your multimedia file to any cloud service of your choice.
  2. To add media to conversations use putMultimedia() method provided by the client you initialised.
  3. Pass in the required parameters.
  4. Process the response as per your requirement.
const payload: any = {
conversationId: "" , // ID of the conversation
filesCount: 1 , // number of files
index: 0, // index at which you are uploading the file
meta: {
size: , //size of file
duration: , // duration of file (only pass in case of video)
},
name: "" , // name of the file
type: "", //tpe of file `image`, `video` and `pdf`
url: "", // cloud service(e.g AWS) response url
}
const response = await lmChatClient.putMultimedia(payload);

if(response.success){
// your function to process the response data
processResponse(response);
}else{
// your function to process error message
processError(response);
}

Put Multimedia Payload

List of parameters provided by putMultimedia().

VariableTypeDescriptionOptional
conversationIdnumberConversation Id
urlstringURL of the multimedia
filesCountnumberCount of attachments
indexnumberIndex of the multimedia
typestringType of the multimedia
metaobjectMeta data of the multimedia
namestringMeta data of the multimedia
thumbnailUrlstringThumbnail URL of the multimedia✔️

Put Multimedia Response

List of parameters in the response.

VariableTypeDescription
successbooleanAPI success status
error_messagestringError message in case of failure
conversationobjectUpdated conversation, after uploading