Returns chat transcript between a specified time range and for an optional specified service id.
HTTP POST /livechat/:domain/getChatTranscriptByTimeRangeAndServiceID
Path Variables:
Name | Mandatory | Type | Description |
---|---|---|---|
domain | YES | STRING | Unique domain identifier |
Headers:
Name | Mandatory | Type | Description |
---|---|---|---|
ctlivetoken | YES | STRING | Unique ctlive session identifier |
Request Body:
Type: JSON
Name | Mandatory | Type | Description |
---|---|---|---|
beginTime | YES | NUMBER | Begin time range. Timestamp in UTC format |
endTime | YES | NUMBER | End time range. Timestamp in UTC format |
serviceID | NO | STRING | Unique service identifier |
Response:
Type: JSON
Name | Type | Description |
---|---|---|
result | BOOLEAN | If true, the service response was performed correctly |
chatTranscript | ARRAY | Array that contains Transcript Object |
error | NULL / STRING | Contains the error description if an error has occurred in the request |
Example:
Request
http://<hostname>:<port>/livechat/default/getChatTranscriptByTimeRangeAndServiceID
Request body:
{ "beginTime": 1583108454335, "endTime": 1583408354335, "serviceID":"447491163403" }
Response
{ "result": true, "chatTranscripts": [ { "result": true, "transcript": { "messages": [ { "data": { "id": "ABEGOTQDYJFpAhCG1QzdRp0jvyFMCl42Jto1", "messageType": "TEXT", "content": { "text": "verde messaggio test", "user": { "id": "391234567890", "isAgent": false } }, "ts": 1583144584635 }, "_id": "5e5cdec513271111989fece0", "room": "CHAT_DEFAULT_483d2215-3dbc-4618-bb96-0a7c6c0c7560" }, { "data": { "id": "977a0077-64ec-4755-b260-62a192a61710", "messageType": "TEXT", "content": { "text": "Buongiorno, sono l'operatore Gabriele Verde, come posso esserle utile?", "user": { "id": "USER_gverde1@acd.enghouse.com", "isAgent": true } }, "ts": 1583144603862 }, "_id": "5e5cdec513271111989fecdf", "room": "CHAT_DEFAULT_483d2215-3dbc-4618-bb96-0a7c6c0c7560" }, { "data": { "id": "ABEGOTQDYJFpAhAK2kKr1hBTb0fVeoUXY---", "messageType": "TEXT", "content": { "text": "verde messaggio test2", "user": { "id": "391234567890", "isAgent": false } }, "ts": 1583144628900 }, "_id": "5e5cdec513271111989fecde", "room": "CHAT_DEFAULT_483d2215-3dbc-4618-bb96-0a7c6c0c7560" } ], "_id": "5e5cdec513271111989fecdd", "room": "CHAT_DEFAULT_483d2215-3dbc-4618-bb96-0a7c6c0c7560", "__v": 0 } } ], "error": null }