getChatHistory

Returns the complete transcript of a currently active chat.

HTTP GET /livechat/:domain/getChatHistory/:chatId

Path Variables:

Name

Mandatory

Type

Description

Name

Mandatory

Type

Description

domain

no

string

Unique domain identifier

chatId

YES

STRING

Unique Chat identifier

Response:

Type: JSONP

Name

Type

Description

Name

Type

Description

result

BOOLEAN

If true, the service response was performed correctly

messages

NULL / ARRAY

An Array that contains all the Message Object

error

NULL / STRING

Contains the error description if an error has occurred in the request

Example:

Request

http://<hostname>:<port>/livechat/default/getChatHistory/CHAT_97656d2c-28b4-41fc-af38-111066cefcaf

Response

{ "result":true, "messages":[ { "room":"CHAT_97656d2c-28b4-41fc-af38-111066cefcaf", "data":{ "id":"30e4e957-cddd-43ee-9d38-ae4acc6c7617", "messageType":"TEXT", "content":{ "text":"How can I help you?", "user":{ "id":"USER_gverde1@acd.enghouse.com", "nickname":"Gabriele Verde", "isAgent":true, "beginTime":1568883355257, "endTime":"", "isOnline":true, "userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.132 Safari/537.36", "firstUri":"http://localhost:3003/AD/AD.html", "firstTitle":"AgentDesktop - Enghouse Interactive", "channel":"web", "firstIP":"::ffff:127.0.0.1" } }, "ts":1568883380589 } }, { "room":"CHAT_97656d2c-28b4-41fc-af38-111066cefcaf", "data":{ "id":"91c4070d-2140-43f0-a107-3d43593420a9", "messageType":"TEXT", "content":{ "text":"Hello", "user":{ "id":"USER_c8e1eb84-60d3-4d69-b10b-96364845023e", "nickname":"Customer", "isAgent":false, "beginTime":1568883353620, "endTime":"", "isOnline":true, "userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.132 Safari/537.36", "firstUri":"http://localhost:3001/domain/test.html", "firstTitle":"LiveChat - Test Page", "channel":"web", "firstIP":"::1" } }, "ts":1568883386307 } }, { "room":"CHAT_97656d2c-28b4-41fc-af38-111066cefcaf", "data":{ "id":"57694a8b-53f6-4b90-b1fb-ce112a4015e1", "messageType":"TEXT", "content":{ "text":"I need information", "user":{ "id":"USER_c8e1eb84-60d3-4d69-b10b-96364845023e", "nickname":"Customer", "isAgent":false, "beginTime":1568883353620, "endTime":"", "isOnline":true, "userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.132 Safari/537.36", "firstUri":"http://localhost:3001/domain/test.html", "firstTitle":"LiveChat - Test Page", "channel":"web", "firstIP":"::1" } }, "ts":1568883398127 } } ], "error":null }

Â