Gets a multimedia message in the chat room.
Parameters:
Name | Mandatory | Type | Description |
---|---|---|---|
chatID | YES | STRING | unique chat identifier |
contactID | YES | STRING | unique message identifier |
Returns:
Type | Description |
---|---|
JS Promise | A Javascript Promise that returns the multimedia message object sent. |
Example:
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("multimedia message retrieved", 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", //possible values: fullsize|thumbnail|link (in case of link, base64 will not be present: to retrieve binary document call /livechat/:domain?/downloadDocument/:chatId/:messageId web service) "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", //possible values: fullsize|thumbnail|link (in case of link, base64 will not be present: to retrieve binary document call /livechat/:domain?/downloadDocument/:chatId/:messageId web service) "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 } */ } ); });