...
Below we list all the available APIs related with a code example. The APIs are related to an istance of active chat, for example the same object returned by calling the joinContact method.
Send a Text message
Code Block |
---|
|
ctlive_contact.sendMessage("Hello world!").then(
function (msgid) {
console.log("Message sent", msgid);
}
); |
Code Block |
---|
breakoutMode | wide |
---|
language | js |
---|
|
// Send a DOCUMENT type message (doc/docx/xls/xlsx/ppt/pptx/pdf)
ctlive_contact.SendMultimediaMessage( "CHAT_eaa2e7c0-9c26-40db-b720-d777ab68078d", "DOCUMENT", Base64Content).then(
function (msgid) {
console.log("Document message sent", msgid);
}
);
// Send an IMAGE type message (png/jpg/jpeg)
ctlive_contact.SendMultimediaMessage( "CHAT_eaa2e7c0-9c26-40db-b720-d777ab68078d", "IMAGE", Base64Content).then(
function (msgid) {
console.log("Image message sent", msgid);
}
);
|
Code Block |
---|
|
ctlive_contact.SendLink("https://www.enghouseinteractive.it/").then (
function (msgid) {
console.log("Hyperlink message sent", msgid);
}
);
|
Code Block |
---|
|
// The agent has started writing
ctlive_contact.isWriting(true);
// The agent has stopped writing
ctlive_contact.isWriting(false); |
Code Block |
---|
|
// End a chat and disconnect all participant.
// The first parameter is the instance of a CTLive active chat.
// The second parameter is reserved and assigned to false
LIVECHATSDK.LIVECHAT.endContact(ctlive_contact, false); |
Code Block |
---|
|
LIVECHATSDK.LIVECHAT.leave("CHAT_eaa2e7c0-9c26-40db-b720-d777ab68078d"); |