ctlive_contact.on("multimediaMessage",
function (event) {
// Get multiemdia message content: call contact API GetMultimediaMessageInActiveChat(<chat_id>,<message_id>)
ctlive_contact.GetMultimediaMessageInActiveChat( ctlive_contact.contact.id, event.id).then(
function (multimediaMessageObj) {
console.log("Imagemultimedia message sentretrieved", msgid);
}
);
multimediaMessageObj);
/*
Example of multimedia object retrieved:
{
"result": true,
"data": {
"chatID": "CHAT_DEFAULT_96387da2-3a5f-4d60-a30d-729e0e5706d8",
"messageID": "a0458869-9747-4ab1-bd76-8727cf483685",
"messageType": "IMAGE",
"domain": "DEFAULT",
"format": "fullsize",
"content": {
"img": "/9j/4AAQSkZJRgABA....",
"caption": "myImage",
"fileName": "45971097-illustrazione-di-happy-emoticon-dà-pollice-in-su-isolato-su-sfondo-bianco.jpg",
"documentType": "jpg",
"user": {
"id": "USER_gverde1@acd.enghouse.com",
"nickname": "Gabriele Verde",
"isAgent": true,
"beginTime": 1584722203945,
"endTime": "",
"isOnline": true,
"userAgent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.132 Safari/537.36",
"firstUri": "http://localhost:3003/AD/AD.html",
"firstTitle": "AgentDesktop - Enghouse Interactive",
"channel": "web",
"firstIP": "::ffff:127.0.0.1"
}
}
},
"error": null
}
{
"result": true,
"data": {
"chatID": "CHAT_DEFAULT_96387da2-3a5f-4d60-a30d-729e0e5706d8",
"messageID": "9c45e6ce-e48f-4d55-beb3-6141ee2b1339",
"messageType": "DOCUMENT",
"domain": "DEFAULT",
"format": "fullsize",
"content": {
"document": "JVBERi0xLjMNJeL.....",
"caption": "myDoc",
"fileName": "WhatsApp - omnichannel API quick guide.pdf",
"documentType": "pdf",
"user": {
"id": "USER_gverde1@acd.enghouse.com",
"nickname": "Gabriele Verde",
"isAgent": true,
"beginTime": 1584722203945,
"endTime": "",
"isOnline": true,
"userAgent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.132 Safari/537.36",
"firstUri": "http://localhost:3003/AD/AD.html",
"firstTitle": "AgentDesktop - Enghouse Interactive",
"channel": "web",
"firstIP": "::ffff:127.0.0.1"
}
}
},
"error": null
}
*/
}
);
}); |