getLastTranscript

Returns the last transcript of a chat in whose contact object the service id is serviceid specified and user id is userid specified.

HTTP POST /livechat/:domain?/getLastTranscript

Path Variables:

Name

Mandatory

Type

Description

Name

Mandatory

Type

Description

domain

YES

STRING

Unique domain identifier

Authorization: see Authentication mechanisms

Request Body:

Name

Mandatory

Type

Description

Name

Mandatory

Type

Description

userid

yes

string

Unique user identifier

serviceid

yes

string

Unique service identifier

Response:

Type: JSON

Name

Type

Description

Name

Type

Description

result

boolean

If true, the service response was performed correctly

error

null / string

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

chatTranscript

object

Transcript Object /

Example:

Request

http://<hostname>:<port>/livechat/default/getLastTranscript

Request Body:

{ "userid":"393401234567", "serviceid":"447491163530" }

Response

{ "result": true, "chatTranscript": { "result": true, "transcript": { "messages": [ { "data": { "id": "23f76471-8d06-407e-931c-a2ecbd6986b2", "messageType": "TEXT", "content": { "text": "verde messaggio test", "user": { "id": "393401234567", "isAgent": false } }, "ts": 1581681488713 }, "_id": "5e468b8368a0d00768b30112", "room": "CHAT_DEFAULT_a9a446b6-1c89-4d80-bbd9-9b30736f8013" }, { "data": { "id": "e255e846-2b32-4079-a210-980587d52039", "messageType": "TEXT", "content": { "text": "Buongiorno, sono l'operatore Gabriele Verde, come posso esserle utile?", "user": { "id": "USER_gverde1@acd.enghouse.com", "isAgent": true } }, "ts": 1581681495663 }, "_id": "5e468b8368a0d00768b30111", "room": "CHAT_DEFAULT_a9a446b6-1c89-4d80-bbd9-9b30736f8013" }, { "data": { "id": "1c8ee9b2-28f2-4133-8e70-e23fa1bd1e12", "messageType": "IMAGE", "content": { "caption": "AA", "documentType": "png", "user": { "id": "USER_gverde1@acd.enghouse.com", "isAgent": true } }, "ts": 1581681513615 }, "_id": "5e468b8368a0d00768b30110", "room": "CHAT_DEFAULT_a9a446b6-1c89-4d80-bbd9-9b30736f8013" } ], "_id": "5e468b8368a0d00768b3010f", "room": "CHAT_DEFAULT_a9a446b6-1c89-4d80-bbd9-9b30736f8013", "__v": 0 } }, "error": null }

 

Â