Get Chat Log
Retrieve all chat messaging-related information in bulk.
| Request | |
|---|---|
| Method | GET |
| Resource | https://[customer].asp.virtual-call-center.eu/v2/projects/[projectid]/chats |
| Options | start, num, direction |
| Body | /N/A |
| Response | |
| Body | Array of chat objects, encoded in JSON. |
Request
Resource parameters
| Name | Type | Mandatory | Comment |
|---|---|---|---|
| projectid | integer | yes | Project unique identifier |
Optional
| Name | Type | Mandatory | Comment |
|---|---|---|---|
| userId | integer | no | The user ID of the last agent who handled the chat |
| entityId | integer | no | The record ID related to the chat |
| startDate | string | no | The date of the session start time in YYYY-MM-DD format |
| start | integer | no | The start ID for pagination. |
| limit | integer | no | The limit for pagination. |
Response
Response object
| Name | Type | Description |
|---|---|---|
| response | array | List of chat log objects returned by the API. |
| responseCount | integer | Number of responses included in the result. |
| sumResponseTime | integer | Total response time aggregated from all chats. |
| transfers | array | List of transfer events related to the chats. |
| transferCount | integer | Number of transfers. |
Chat object
| Name | Type | Description |
|---|---|---|
| chatId | integer | Unique identifier of the chat. |
| projectId | integer | Identifier of the project where the chat belongs. |
| entityId | integer | Record identifier related to the chat. |
| contactId | integer | Unique identifier of the contact. |
| ticketId | integer | Unique identifier of the related ticket. |
| ticketNo | string | Ticket reference number. |
| sessionId | string | Unique identifier of the chat session. |
| type | string | Channel type (e.g. webchat, telegram, messenger). |
| pageName | string | Name of the page where the chat was initiated. |
| visitorName | string | The visitor’s display name. |
| firstAgent | integer | Identifier of the first agent who handled the chat. |
| lastAgent | integer | Identifier of the last agent who handled the chat. |
| firstQueueId | integer | Identifier of the first queue. |
| lastQueueId | integer | Identifier of the last queue. |
| ipAddress | string | IP address of the visitor. |
| firstURL | string | First visited URL during the session. |
| lastURL | string | Last visited URL during the session. |
| sessionStartTime | string | Date and time when the session started. |
| sessionCloseTime | string | Date and time when the session was closed. |
| duration | integer | Duration of the session in seconds. |
| firstVisitorMessageTime | string | Timestamp of the first visitor message. |
| firstAgentMessageTime | string | Timestamp of the first agent response. |
| lastVisitorMessageTime | string | Timestamp of the last visitor message. |
| lastAgentMessageTime | string | Timestamp of the last agent message. |
| isSPAM | integer | Indicates whether the chat was marked as spam (0 = false, 1 = true). |
| disposition | string | Final status of the chat (e.g. Completed, Missed, In progress). |
| firstResponseTime | integer | Time in seconds until the first agent response. |
| averageResponseTime | integer | Average response time during the chat. |
| slaStatus | string | SLA status of the chat. |
| transcript | array | List of messages exchanged during the chat. |
| visitorTranscript | string | All visitor messages concatenated into a single string. |
| agentTranscript | string | All agent messages concatenated into a single string. |
| firstAgentName | string | Name of the first agent. |
| lastAgentName | string | Name of the last agent. |
| firstQueueName | string | Name of the first queue. |
| lastQueueName | string | Name of the last queue. |
| ticketTypeId | integer | Identifier of the ticket type. |
| transferCount | integer | Number of transfers during the chat. |
Transcript object
| Name | Type | Description |
|---|---|---|
| id | string | Unique identifier of the message. |
| date | string | Timestamp of the message in ISO format. |
| message | string | Content of the message. |
| name | string | Name of the sender. |
| pageUrl | string | URL of the page where the message was sent. |
| pageTitle | string | Title of the page. |
| attachments | array | List of attachments associated with the message. |
Attachment object
| Name | Type | Description |
|---|---|---|
| type | string | Type of the attachment (e.g. image). |
| payload.url | string | URL to the attachment. |
Example
Retrieving a chat log
Request
Response body
{
"response": [
{
"chatId": 1,
"projectId": 822,
"entityId": 6,
"contactId": 6,
"ticketId": 15,
"ticketNo": "822-20230120-785643",
"sessionId": "webchat-plugin/customer/5ded6967-565c-4f3b-83c4-0c4bfdae3e51",
"type": "webchat",
"pageName": "",
"visitorName": "",
"firstAgent": 660,
"lastAgent": 660,
"firstQueueId": 3803,
"lastQueueId": 3803,
"ipAddress": "",
"firstURL": "",
"lastURL": "",
"sessionStartTime": "2023-01-20 11:50:43",
"sessionCloseTime": "2023-01-20 12:54:01",
"duration": 198,
"firstVisitorMessageTime": "2023-01-20 11:50:43",
"firstAgentMessageTime": "2023-01-20 11:50:50",
"lastVisitorMessageTime": "2023-01-20 12:50:43",
"lastVisitorMessageAgentResponseTime": null,
"lastAgentMessageTime": "2023-01-20 12:52:43",
"isSPAM": 0,
"transcript": [
{
"attachments": null,
"date": "2023-01-20T12:50:43+01:00",
"id": "c6d9fa93-3156-4179-9910-ecf39579c387",
"message": "Hi there",
"name": "Visitor",
"pageUrl": "",
"pageTitle": ""
},
{
"attachments": null,
"date": "2023-01-20T12:50:50+01:00",
"id": "e332d1cb-6f70-42ea-8153-a9270c6ec439",
"message": "hello",
"name": "John Smith",
"pageUrl": "",
"pageTitle": ""
},
{
"attachments": null,
"date": "2023-01-20T12:52:43+01:00",
"id": "4dfb8a3d-3e02-4743-bafd-42e29eea498d",
"message": "How can I help you?",
"name": "John Smit",
"pageUrl": "",
"pageTitle": ""
}
],
"visitorTranscript": "Hi there",
"agentTranscript": "hello How can I help you?",
"disposition": "Completed",
"firstResponseTime": 7,
"averageResponseTime": 7,
"slaStatus": "Within SLA",
"chatLog": null,
"firstQueue": null,
"lastQueue": null,
"firstAgentName": "John Smith",
"lastAgentName": "John Smith",
"firstQueueName": "Chat",
"lastQueueName": "Chat",
"ticketTypeId": 1,
"ticketType": {
"fieldId": null,
"valueId": 1,
"label": "Request",
"exportValue": "Request",
"params": [],
"fgColor": "",
"bgColor": "",
"sort": null,
"status": null,
"system": 0,
"fieldValueId": null
},
"responseCount": null,
"sumResponseTime": null,
"transfers": [],
"transferCount": 0
}
],
"errors": []
}
Comments
Can’t find what you need? Use the comment section below to connect with others, get answers from our experts, or share your ideas with us.
There are no comments yet.