--- title: "Chat" slug: "server-api-livechat-chat" updated: 2024-12-03T05:46:57Z published: 2024-12-03T05:46:57Z canonical: "developer.comm100.com/server-api-livechat-chat" --- > ## Documentation Index > Fetch the complete documentation index at: https://developer.comm100.com/llms.txt > Use this file to discover all available pages before exploring further. # Chat - `Chats` - Chats Manage - `GET livechat/chats/{id}` - [Get a single Chat](/docs/server-api-livechat-chat#get-a-single-chat) - `POST livechat/chats/{id}:AttachToTicket` - [Attach to Ticket](/docs/server-api-livechat-chat#attach-to-ticket) - `POST livechat/chats:Search` - [Search Chats](/docs/server-api-livechat-chat#search-chats) - `POST livechat/missedAndRefusedChats:Search` - [Search Missed & Refused Chats](/docs/server-api-livechat-chat#search-missed-refused-chats) - `PUT livechat/chats/{id}` - [Update the Chat Ticket](/docs/server-api-livechat-chat#update-the-chat-ticket) - `DELETE livechat/chats` - [Batch Delete Chats](/docs/server-api-livechat-chat#batch-delete-chats) - `DELETE livechat/chats/{id}` - [Delete a Single Chat](/docs/server-api-livechat-chat#delete-a-single-chat) - `Chat Wrapup Categories` - Chat Wrapup Categories Manage - `GET livechat/chatWrapupCategories` - [Get the list of Chat Wrapup Categories](/docs/server-api-livechat-chat#get-the-list-of-chat-wrapup-categories) - `GET livechat/chatWrapupCategories/{id}` - [Get a single Chat Wrapup Category](/docs/server-api-livechat-chat#get-a-single-chat-wrapup-category) - `POST livechat/chats/{id}/ChatWrapupCategories` - [Update Chat Wrapup Category](/docs/server-api-livechat-chat#update-chat-wrapup-category) - `Chat Wrapup` - Chat Wrapup Comment Manage - `POST livechat/chats/{id}/chatWrapups` - [Create the Chat Wrapup](/docs/server-api-livechat-chat#create-the-chat-wrapup) - `PUT livechat/chats/{id}/chatWrapup` - [Update the Chat Wrapup](/docs/server-api-livechat-chat#update-the-chat-wrapup) - `Chat Field Results` - Chat Wrapup Field Results Manage - `POST livechat/chatFieldResults` - [Update Chat Wrapup Field Results](/docs/server-api-livechat-chat#update-chat-wrapup-field-results) ### Chat JSON Format Chat is represented as simple flat JSON objects with the following keys: | Name | Type | Description | | --- | --- | --- | | `id` | integer | Id of the chat. | | `sessionId` | guid | Id of the session. | | `startTime` | datetime | Time when the chat started. | | `endTime` | datetime | Time when the chat ended. | | `isQueued` | bool | Whether the chat is queued or not. | | `ifAudioChatHappened` | bool | Whether audio chat happened during the live chat session or not. | | `ifVideoChatHappened` | bool | Whether video chat happened during the live chat session or not. | | `status` | string | Allowed values are 0("normal"), 1("refused"), 2("missed"). | | `messages` | string | Messages of the chat. | | `requestingPageTitle` | string | Page title of the requesting page. | | `requestingPageURL` | string | Page URL of the requesting page. | | `source` | string | Allowed values are 0("chatButton"), 1("autoInvitation"), 2("manualInvitation"). | | `autoInvitationId` | guid | Id of the auto invitation. | | `preChatSocialMediaSource` | integer | Allowed values are 0("none"), 1("facebook"). | | `preChatSocialProfileURL` | string | Pre-chat social profile URL of the chat. | | `preChatName` | string | Pre-chat name of the chat. | | `preChatEmail` | string | Pre-chat email of the chat. | | `preChatPhone` | string | Pre-chat phone of the chat. | | `preChatCompany` | string | Pre-chat company of the chat. | | `preChatProductService` | string | Pre-chat product service of the chat. | | `preChatTicketId` | integer | Id of the ticket to which this chat is attached. | | `departmentId` | guid | Id of the department. | | `skillId` | guid | Id of the skill. | | `requestedTime` | datetime | The time when the chat is requested. | | `avgResponseTime` | float | The average response time of the chat. | | `visitorMessagesCount` | integer | The number of messages sent by visitors. | | `agentMessagesCount` | integer | The number of messages sent by agents. | | `campaignId` | guid | Id of the campaign. | | `waitingTime` | integer | The waiting time before the chat got accepted/missed. | | `duration` | integer | The duration of the chat. | | `cannedMessageCount` | integer | The number of canned messages sent during the chat. | | `botDuration` | integer | The bot duration of the chat. | | `agentDuration` | integer | The agent duration of the chat. | | `lastMessageSentBy` | string | Allowed values are 0("visitor"), 1("agent"), 2("system"), 3("chatBot"). | | `botId` | guid | Id of the bot. | | `guid` | guid | Guid of the chat. | | `visitorId` | guid | Id of the visitor. | | `contactIdentityId` | guid | Id of the contact identity. | | `chatAgents` | [chatAgents[]](/docs/server-api-livechat-chat#chat-agent-json-format) | Reference to . | | `chatType` | string | Type of the chat. 0("agentOnly"), 1("chatBotOnly"), 2("fromBotToAgent"), 3("chatBot"), 4("fromBottoOfflineMessage"), 32("taskBotOnly") | ### Chat Agent JSON Format: | Name | Type | Description | | --- | --- | --- | | `chatId` | integer | Id of the chat. | | `agentId` | guid | Id of the agent. | | `startTime` | datetime | Time when the chat started. | | `endTime` | datetime | Time when the chat ended. | | `duration` | integer | Duration of the chat. | | `id` | integer | Content of the custom page. | ### Chat Field Result JSON Format Chat Field Result is represented as simple flat JSON objects with the following keys: | Name | Type | Description | | --- | --- | --- | | `id` | selfIncrementId | Id of the chat field result. | | `chatId` | integer | Id of the chat which the chat field result belongs to. | | `formType` | string | Form field type of the chat field result.Allowed values are "preChat", "offlineMessage", "postChat", "wrapUp", "pciForm", "customVariable". | | `fieldId` | guid | Id of the field which the chat field result belongs to. | | `fieldName` | string | Name of the field which the chat field result belongs to. | | `value` | string | Value of the chat field result. | | `url` | string | Url of the chat field result. | ### Get a single Chat `GET livechat/chats/{id}` - #### Parameters: | Name | Type | in | Required | Description | | --- | --- | --- | --- | --- | | `include` | string | query | no | Available values for Include are: "autoInvitation", "campaign", "chatAgent", "chatChatbotMap","chatAttachment", "chatFieldResult", "chatSegmentResult", "chatWrapup", "chatWrapupCategory", "contactIdentity", "department", "postChatSurvey", "session", "skill", "visitor". | | `id` | integer or guid | path | yes | Id of the chat or Guid of the chat. | - #### Response: [Chat](/docs/server-api-livechat-chat#chat-json-format) - #### Example Sample Request: ``` curl https://api11.comm100.io/v4/livechat/chats/4875 \ -X 'GET' \ -H 'Authorization: Bearer {access_token}' \ ``` Response: HTTP/1.1 200 OK ``` { "id": 4875, "guid": "2efc01b2-b7c1-40a9-b049-b0db9fbc4dbc", "sessionId": "f8383a83-48e9-4d0d-a3bd-fb19ce5c12db", "visitorId": "e11203f5-1d97-4c48-8fc2-fc6257d4e13b", "contactIdentityId": "00000000-0000-0000-0000-000000000000", "startTime": "2021-04-27T07:50:28.753Z", "endTime": "2021-04-27T08:01:29.003Z", "status": "normal", "requestingPageTitle": "Preview", "requestingPageURL": "https://dash11.comm100.io/frontEnd/assets/livechat/previewpage/?campaignId=bd8fc603-6d63-49e2-b594-db015c221b40&siteId=10000&q=1619509862473", "preChatSocialMediaSource": 0, "preChatSocialProfileURL": "", "preChatName": "1", "preChatEmail": "1@1.com", "preChatProductService": "", "preChatPhone": "", "preChatCompany": "", "preChatTicketId": -1, "departmentId": "00000000-0000-0000-0000-000000000000", "skillId": "00000000-0000-0000-0000-000000000000", "requestedTime": "2021-04-27T07:50:28.7533333Z", "offlineMessageId": 0, "avgResponseTime": 6.0, "visitorMessagesCount": 1, "agentMessagesCount": 4, "campaignId": "bd8fc603-6d63-49e2-b594-db015c221b40", "lastMessageSentBy": "agent", "duration": "00:11:00", "source": "chatButton", "waitingTime": "00:00:00", "autoInvitationId": "00000000-0000-0000-0000-000000000000", "botDuration": "00:00:00", "agentDuration": "00:11:00", "botId": "00000000-0000-0000-0000-000000000000", "chatType": "agentOnly", "messages": [ { "chatAction": "agentAcceptChat", "message": "Agent may1 may has joined the chat.", "senderType": "system", "senderName": "", "time": "2021-04-27T07:50:29Z", "translatedMessage": "", "attachment": "" }, { "chatAction": "visitorAddTextMessage", "message": "13", "senderType": "visitor", "senderName": "1", "time": "2021-04-27T08:00:15Z", "translatedMessage": "", "attachment": "" }, { "chatAction": "agentSendText", "message": "123", "senderType": "agent", "senderName": "may1 may", "time": "2021-04-27T08:00:21Z", "translatedMessage": "", "attachment": "" }, { "chatAction": "agentSendText", "message": "1223", "senderType": "agent", "senderName": "may1 may", "time": "2021-04-27T08:00:23Z", "translatedMessage": "", "attachment": "" }, { "chatAction": "agentSendNoteText", "message": "hello", "senderType": "agent", "senderName": "may1 may", "time": "2021-04-27T08:01:01Z", "translatedMessage": "", "attachment": "" }, { "chatAction": "agentSendNoteText", "message": "hello", "senderType": "agent", "senderName": "may1 may", "time": "2021-04-27T08:01:03Z", "translatedMessage": "", "attachment": "" }, { "chatAction": "agentSendText", "message": "12321", "senderType": "agent", "senderName": "may1 may", "time": "2021-04-27T08:01:12Z", "translatedMessage": "", "attachment": "" }, { "chatAction": "agentSendNoteFile", "message": "Agent may1 may has sent a file: Chats_20210305 (5).csv", "senderType": "agent", "senderName": "https://api11.comm100.io/FileService/v1/files/H7UXY7FigsxUUInQBoKTqn4QYq9yanARl5jD2iZzSD-ZZQm_A4X_QhFkvatVYg9ljsmPfllZ6LAF0JkxfJoiSAqko0HU35tUkKqTJlmltzUAb2-scyNlY7Z7EvRyJsYpDZIOgscGydXov-X3zJ6vtzB51_fEGdnrEhbrBXwI9pww?Chats_20210305 (5).csv?may1 may", "time": "2021-04-27T08:01:20Z", "translatedMessage": "", "attachment": "H7UXY7FigsxUUInQBoKTqn4QYq9yanARl5jD2iZzSD-ZZQm_A4X_QhFkvatVYg9ljsmPfllZ6LAF0JkxfJoiSAqko0HU35tUkKqTJlmltzUAb2-scyNlY7Z7EvRyJsYpDZIOgscGydXov-X3zJ6vtzB51_fEGdnrEhbrBXwI9pww" }, { "chatAction": "agentSendText", "message": "31232312", "senderType": "agent", "senderName": "may1 may", "time": "2021-04-27T08:01:23Z", "translatedMessage": "", "attachment": "" }, { "chatAction": "agentEndChat", "message": "Agent may1 may has left the chat.", "senderType": "agent", "senderName": "", "time": "2021-04-27T08:01:29Z", "translatedMessage": "", "attachment": "" }, { "chatAction": "systemEndChat", "message": "The chat is ended.", "senderType": "system", "senderName": "", "time": "2021-04-27T08:01:29Z", "translatedMessage": "", "attachment": "" } ] } ``` ### Attach to Ticket `POST livechat/chats/{id}:AttachToTicket` - #### Parameters: | Name | Type | in | Required | Description | | --- | --- | --- | --- | --- | | `id` | int | path | yes | Id of the chat. | | `utcOffset` | int | body | no | UTC Offset of the user. | | `targetId` | integer | body | yes | Id of the ticket to which this chat is attached. | | `dateTimeFormat` | string | body | no | Datetime format of the user. | - #### Response: No Content - #### Example Sample Request: ``` curl https://api11.comm100.io/v4/livechat/chats/1:AttachToTicket \ -X 'POST' \ -H 'Authorization: Bearer {access_token}' \ -H 'Content-Type: application/json' \ -D '{"targetId":"2858","utcOffset":-420,"datetimeFormat":"YYYY/MM/DD HH:mm:ss"}' ``` Response: HTTP/1.1 200 OK ### Search Chats `POST livechat/chats:Search` - #### Parameters: | Name | Type | in | Required | Description | | --- | --- | --- | --- | --- | | `include` | string | query | no | Available values for Include are: "autoInvitation", "campaign", "chatAgent", "chatAttachment", "chatFieldResult", "chatSegmentResult", "chatWrapup", "chatWrapupCategory", "contactIdentity", "department", "postChatSurvey", "session", "skill", "visitor". | | `pageIndex` | integer | query | no | Page index. | | `filters` | array | body | no | Filter array. Available items are: requestedTime, departmentId, skillId, agent, chatChatbotMap.botId, categoryOptionId, keywords and other custom filters. \| name \| operator \| note \| \| --- \| --- \| --- \| \| requestedTime \| is \| Requested Time, selected time range, e.g., ["2024-01-11T00:00:00+08:00", "2024-01-12T00:00:00+08:00"] \| \| departmentId \| is/isNot \| Department, selected department id, e.g., ["3ed53140-8cc9-4149-9ee6-5b3f0a44c822"] \| \| skillId \| is/isNot \| Skill, selected skill id, e.g., ["ae99aa1e-eb77-4546-942f-2f590e4c7b5d"] \| \| agent \| is/exists \| Agent, selected agent id, e.g., ["fe99111e-eb77-4546-942f-2f590e4c7b5d"]. When operator is exists, the value should be [""] \| \| chatChatbotMap.botId \| is/isNot \| Bot, selected bot id, e.g., ["7184f6f3-0d13-4bd1-a55b-a4c21f375d9b"] \| \| categoryOptionId \| is/exists/notExists \| Category, selected category option id, e.g., ["09dfb586-4692-4b09-a815-c541337d59da"] \| \| keywords \| is \| Keywords, input string, e.g., ["Comm100"] \| \| campaign \| isOneOf/isNotOneOf/contains/notContains/regularExpression \| Campaign, selected campaign id(s) array, e.g., ["87441e0b-056f-4008-b455-b6e1e9098c91"] \| \| duration \| is/isMoreThan/isLessThan \| Duration, selected int, e.g., [1]. The unit of the value is second. \| \| preChatName \| contains/notContains \| Name, input string, e.g., ["Kate"] \| \| preChatEmail \| contains/notContains \| Email, input string, e.g., ["kate@comm100.com"] \| \| preChatPhone \| contains/notContains \| Phone, input string, e.g., ["800231111"] \| \| preChatCompany \| contains/notContains \| Company, input string, e.g., ["comm100"] \| \| preChatProductService \| is/isNot \| Produce Service, selected string, e.g., ["Support"] \| \| guid \| is/isNot \| Chat ID, input chat guid, e.g., ["09dfb586-4692-4b09-a815-c541337d59da"] \| \| chatType \| is/isNot \| Chat Type, selected chat type enum int value, e.g., ["0"] \| \| {!postChatSurvey.ratingGrade} \| is/isNot/exists/notExists \| Rating, selected rating int value array, e.g., ["1"] \| \| {!postChatSurvey.ratingComment} \| contains/notContains/isNot/is \| Rating Comment, input string, e.g., ["Kate Comment"] \| \| {!botSentimentRecord.veryNegativeCount} \| is/isNot/isMoreThan/isLessThan \| Counts of Very Negative, selected int value, e.g., ["0"] \| \| {!botSentimentRecord.negativeCount} \| is/isNot/isMoreThan/isLessThan \| Counts of Negative, selected int value, e.g., ["0"] \| \| {!chatWrapup.comment} \| contains/notContains \| Agent Comment, input string, e.g., ["Comm100 Comment"] \| \| {!chatSegmentResult.segmentId} \| is/isNot \| Segment, selected segment id, e.g., ["ec174891-73bd-4267-8e53-530ae510d343"] \| \| autoInvitationId \| is/isNot \| Auto Invitation, selected auto invitation id, e.g., ["71b1b61a-c905-484a-aacf-155a50e65bd8"] \| \| {!transferLog.fromDepartmentId} \| is/isNot \| Transferred-out Department, selected department id, e.g., ["71b1b61a-c905-484a-aacf-155a50e65bd8"] \| \| {!transferLog.toDepartmentId} \| is/isNot \| Transferred-in Department, selected department id, e.g., ["71b1b61a-c905-484a-aacf-155a50e65bd8"] \| \| transferred \| is/isNot \| Transferred, selected value, e.g., ["true"] or ["false"] \| \| {!transferLog.transferType} \| is/isNot \| Cross-site Transferred-in, the value should be ["10"] \| \| {!transferLog.transferType} \| is/isNot \| Cross-site Transferred-out, the value should be ["6"] \| \| ssoUserId \| is \| SSO User Id, input string, e.g., ["jasonSso"] \| \| status \| is/isNot \| Chat Status, selected status enum int value, e.g., ["0"] \| \| source \| is/isNot \| Chat Source, selected source enum int value, e.g., ["0"] \| \| lastMessageSentBy \| is/isNot \| Last Message Sent By, selected last message sentBy enum int value, e.g., ["0"] \| \| Other custom filter, allowed values are all fields of chat, preChatFormField, postChatFormField, wrapupFormField, customVariable. \| Allowed values are "is", "contains", "notContains", "isMoreThan", "isLessThan", "isNot", "isNotLessThan", "isNotMoreThan", "regularExpression", "isOneOf", "isNotIn", e.g., contains. \| Input value for this filter, e.g., when it is a form field, it should be [{"fieldId":"2ac8739a-c2ae-4924-9a7d-8ac31faf147f","campaignId":"87441e0b-056f-4008-b455-b6e1e9098c91","value":["123456"]}], when it is a custom variable, it should be [{"fieldId":"4ebbb40c-7569-47e8-bd3a-555687e9efe3","value":["customva"]}]. \| | | name | operator | note | | requestedTime | is | Requested Time, selected time range, e.g., ["2024-01-11T00:00:00+08:00", "2024-01-12T00:00:00+08:00"] | | departmentId | is/isNot | Department, selected department id, e.g., ["3ed53140-8cc9-4149-9ee6-5b3f0a44c822"] | | skillId | is/isNot | Skill, selected skill id, e.g., ["ae99aa1e-eb77-4546-942f-2f590e4c7b5d"] | | agent | is/exists | Agent, selected agent id, e.g., ["fe99111e-eb77-4546-942f-2f590e4c7b5d"]. When operator is exists, the value should be [""] | | chatChatbotMap.botId | is/isNot | Bot, selected bot id, e.g., ["7184f6f3-0d13-4bd1-a55b-a4c21f375d9b"] | | categoryOptionId | is/exists/notExists | Category, selected category option id, e.g., ["09dfb586-4692-4b09-a815-c541337d59da"] | | keywords | is | Keywords, input string, e.g., ["Comm100"] | | campaign | isOneOf/isNotOneOf/contains/notContains/regularExpression | Campaign, selected campaign id(s) array, e.g., ["87441e0b-056f-4008-b455-b6e1e9098c91"] | | duration | is/isMoreThan/isLessThan | Duration, selected int, e.g., [1]. The unit of the value is second. | | preChatName | contains/notContains | Name, input string, e.g., ["Kate"] | | preChatEmail | contains/notContains | Email, input string, e.g., ["kate@comm100.com"] | | preChatPhone | contains/notContains | Phone, input string, e.g., ["800231111"] | | preChatCompany | contains/notContains | Company, input string, e.g., ["comm100"] | | preChatProductService | is/isNot | Produce Service, selected string, e.g., ["Support"] | | guid | is/isNot | Chat ID, input chat guid, e.g., ["09dfb586-4692-4b09-a815-c541337d59da"] | | chatType | is/isNot | Chat Type, selected chat type enum int value, e.g., ["0"] | | {!postChatSurvey.ratingGrade} | is/isNot/exists/notExists | Rating, selected rating int value array, e.g., ["1"] | | {!postChatSurvey.ratingComment} | contains/notContains/isNot/is | Rating Comment, input string, e.g., ["Kate Comment"] | | {!botSentimentRecord.veryNegativeCount} | is/isNot/isMoreThan/isLessThan | Counts of Very Negative, selected int value, e.g., ["0"] | | {!botSentimentRecord.negativeCount} | is/isNot/isMoreThan/isLessThan | Counts of Negative, selected int value, e.g., ["0"] | | {!chatWrapup.comment} | contains/notContains | Agent Comment, input string, e.g., ["Comm100 Comment"] | | {!chatSegmentResult.segmentId} | is/isNot | Segment, selected segment id, e.g., ["ec174891-73bd-4267-8e53-530ae510d343"] | | autoInvitationId | is/isNot | Auto Invitation, selected auto invitation id, e.g., ["71b1b61a-c905-484a-aacf-155a50e65bd8"] | | {!transferLog.fromDepartmentId} | is/isNot | Transferred-out Department, selected department id, e.g., ["71b1b61a-c905-484a-aacf-155a50e65bd8"] | | {!transferLog.toDepartmentId} | is/isNot | Transferred-in Department, selected department id, e.g., ["71b1b61a-c905-484a-aacf-155a50e65bd8"] | | transferred | is/isNot | Transferred, selected value, e.g., ["true"] or ["false"] | | {!transferLog.transferType} | is/isNot | Cross-site Transferred-in, the value should be ["10"] | | {!transferLog.transferType} | is/isNot | Cross-site Transferred-out, the value should be ["6"] | | ssoUserId | is | SSO User Id, input string, e.g., ["jasonSso"] | | status | is/isNot | Chat Status, selected status enum int value, e.g., ["0"] | | source | is/isNot | Chat Source, selected source enum int value, e.g., ["0"] | | lastMessageSentBy | is/isNot | Last Message Sent By, selected last message sentBy enum int value, e.g., ["0"] | | Other custom filter, allowed values are all fields of chat, preChatFormField, postChatFormField, wrapupFormField, customVariable. | Allowed values are "is", "contains", "notContains", "isMoreThan", "isLessThan", "isNot", "isNotLessThan", "isNotMoreThan", "regularExpression", "isOneOf", "isNotIn", e.g., contains. | Input value for this filter, e.g., when it is a form field, it should be [{"fieldId":"2ac8739a-c2ae-4924-9a7d-8ac31faf147f","campaignId":"87441e0b-056f-4008-b455-b6e1e9098c91","value":["123456"]}], when it is a custom variable, it should be [{"fieldId":"4ebbb40c-7569-47e8-bd3a-555687e9efe3","value":["customva"]}]. | | `pageSize` | integer | query | no | Page size. The available value is from 10 to 500, and the default value is 50. | - #### Response: An array of [Chat](/docs/server-api-livechat-chat#chat-json-format) - #### Example Sample Request: ``` curl https://api11.comm100.io/v4/livechat/chats:search \ -X 'POST' \ -H 'Authorization: Bearer {access_token}' \ -H 'Content-Type: application/json' \ -D '{"filters":[{"name":"requestedTime","operator":"is","value":["2021-04-01T00:00:00+08:00","2021-05-09T00:00:00+08:00"]},{"name":"keywords","operator":"is","value":["file"]},{"name":"departmentId","operator":"is","value":["397eed79-f3a3-4d7c-ab9b-29c78e5bf152"]},{"name":"skillId","operator":"is","value":["6908B37E-A023-47DC-A24C-08246C2BF22A"]},{"name":"botId","operator":"is","value":["2f5e6532-4aeb-4f5f-89ae-596b97c3e662"]},{"name":"agent","operator":"is","value":["9ce9d087-fe54-4e48-a593-d82ea01b99ae"]},{"name":"categoryOptionId","operator":"is","value":["96d4431e-ed3e-4bb1-b2c0-1b3a18169838"]}]}' ``` Response: HTTP/1.1 200 OK ``` { "total": 4, "pageCount": 1, "list": [ { "id": 4878, "guid": "17d3c22b-ddd4-4b35-8d52-4cea650386a0", "sessionId": "57b267a0-f8d8-4e0d-ad8f-3bab8cee9f5e", "visitorId": "e11203f5-1d97-4c48-8fc2-fc6257d4e13b", "contactIdentityId": "00000000-0000-0000-0000-000000000000", "startTime": "2021-04-27T08:52:04.88Z", "endTime": "2021-04-27T08:59:30.847Z", "status": "normal", "requestingPageTitle": "Preview", "requestingPageURL": "https://dash11.comm100.io/frontEnd/assets/livechat/previewpage/?campaignId=bd8fc603-6d63-49e2-b594-db015c221b40&siteId=10000&q=1619509862473", "preChatSocialMediaSource": 0, "preChatSocialProfileURL": "", "preChatName": "1", "preChatEmail": "1@1.com", "preChatProductService": "", "preChatPhone": "", "preChatCompany": "", "preChatTicketId": -1, "departmentId": "00000000-0000-0000-0000-000000000000", "skillId": "00000000-0000-0000-0000-000000000000", "requestedTime": "2021-04-27T08:52:04.88Z", "offlineMessageId": 0, "avgResponseTime": 0.0, "visitorMessagesCount": 0, "agentMessagesCount": 0, "campaignId": "bd8fc603-6d63-49e2-b594-db015c221b40", "lastMessageSentBy": "system", "duration": "00:07:25", "source": "chatButton", "waitingTime": "00:00:00", "autoInvitationId": "00000000-0000-0000-0000-000000000000", "botDuration": "00:00:00", "agentDuration": "00:07:25", "botId": "00000000-0000-0000-0000-000000000000", "chatType": "agentOnly", "messages": [ { "chatAction": "agentAcceptChat", "message": "Agent may1 may has joined the chat.", "senderType": "system", "senderName": "", "time": "2021-04-27T08:52:05Z", "translatedMessage": "", "attachment": "" }, { "chatAction": "agentEndChat", "message": "Agent may1 may has left the chat.", "senderType": "agent", "senderName": "", "time": "2021-04-27T08:59:31Z", "translatedMessage": "", "attachment": "" }, { "chatAction": "systemEndChat", "message": "The chat is ended.", "senderType": "system", "senderName": "", "time": "2021-04-27T08:59:31Z", "translatedMessage": "", "attachment": "" } ], "session": { "id": "57b267a0-f8d8-4e0d-ad8f-3bab8cee9f5e", "visitorId": "e11203f5-1d97-4c48-8fc2-fc6257d4e13b", "contactIdentityId": "00000000-0000-0000-0000-000000000000", "ip": "192.168.2.128", "referrerURL": "https://dash11.comm100.io/frontEnd/assets/livechat/previewpage/?campaignId=bd8fc603-6d63-49e2-b594-db015c221b40&siteId=10000", "searchEngineId": "00000001-0000-0000-0000-000000000001", "keywords": "", "landingPageURL": "https://dash11.comm100.io/frontEnd/assets/livechat/previewpage/?campaignId=bd8fc603-6d63-49e2-b594-db015c221b40&siteId=10000&q=1619509862473", "landingPageTitle": "", "startTime": "2021-04-27T08:50:31.8333333Z", "browser": "Google Chrome 86.0.4240.75", "operatorSystem": "Windows 8.1", "screenResolution": "1680x1050", "language": "zh-CN", "timeZone": "-480" } }, { "id": 4879, "guid": "94a5836a-cab6-4b30-99d7-24492fc756a2", "sessionId": "57b267a0-f8d8-4e0d-ad8f-3bab8cee9f5e", "visitorId": "e11203f5-1d97-4c48-8fc2-fc6257d4e13b", "contactIdentityId": "00000000-0000-0000-0000-000000000000", "startTime": "2021-04-27T08:50:33.863Z", "endTime": "2021-04-27T08:50:52.317Z", "status": "normal", "requestingPageTitle": "Preview", "requestingPageURL": "https://dash11.comm100.io/frontEnd/assets/livechat/previewpage/?campaignId=bd8fc603-6d63-49e2-b594-db015c221b40&siteId=10000&q=1619509862473", "preChatSocialMediaSource": 0, "preChatSocialProfileURL": "", "preChatName": "1", "preChatEmail": "1@1.com", "preChatProductService": "", "preChatPhone": "", "preChatCompany": "", "preChatTicketId": -1, "departmentId": "00000000-0000-0000-0000-000000000000", "skillId": "00000000-0000-0000-0000-000000000000", "requestedTime": "2021-04-27T08:50:33.8633333Z", "offlineMessageId": 0, "avgResponseTime": 0.0, "visitorMessagesCount": 0, "agentMessagesCount": 0, "campaignId": "bd8fc603-6d63-49e2-b594-db015c221b40", "lastMessageSentBy": "system", "duration": "00:00:18", "source": "chatButton", "waitingTime": "00:00:00", "autoInvitationId": "00000000-0000-0000-0000-000000000000", "botDuration": "00:00:00", "agentDuration": "00:00:18", "botId": "00000000-0000-0000-0000-000000000000", "chatType": "agentOnly", "messages": [ { "chatAction": "agentAcceptChat", "message": "Agent may1 may has joined the chat.", "senderType": "system", "senderName": "", "time": "2021-04-27T08:50:34Z", "translatedMessage": "", "attachment": "" }, { "chatAction": "agentEndChat", "message": "Agent may1 may has left the chat.", "senderType": "agent", "senderName": "", "time": "2021-04-27T08:50:52Z", "translatedMessage": "", "attachment": "" }, { "chatAction": "systemEndChat", "message": "The chat is ended.", "senderType": "system", "senderName": "", "time": "2021-04-27T08:50:52Z", "translatedMessage": "", "attachment": "" } ], "session": { "id": "57b267a0-f8d8-4e0d-ad8f-3bab8cee9f5e", "visitorId": "e11203f5-1d97-4c48-8fc2-fc6257d4e13b", "contactIdentityId": "00000000-0000-0000-0000-000000000000", "ip": "192.168.2.128", "referrerURL": "https://dash11.comm100.io/frontEnd/assets/livechat/previewpage/?campaignId=bd8fc603-6d63-49e2-b594-db015c221b40&siteId=10000", "searchEngineId": "00000001-0000-0000-0000-000000000001", "keywords": "", "landingPageURL": "https://dash11.comm100.io/frontEnd/assets/livechat/previewpage/?campaignId=bd8fc603-6d63-49e2-b594-db015c221b40&siteId=10000&q=1619509862473", "landingPageTitle": "", "startTime": "2021-04-27T08:50:31.8333333Z", "browser": "Google Chrome 86.0.4240.75", "operatorSystem": "Windows 8.1", "screenResolution": "1680x1050", "language": "zh-CN", "timeZone": "-480" } }, { "id": 4877, "guid": "67d71d4b-8a6f-45fd-afa8-f158473ec125", "sessionId": "2db8f0e0-b040-46fb-821d-4e45149ac03e", "visitorId": "e11203f5-1d97-4c48-8fc2-fc6257d4e13b", "contactIdentityId": "00000000-0000-0000-0000-000000000000", "startTime": "2021-04-27T08:36:27.833Z", "endTime": "2021-04-27T08:37:05.737Z", "status": "normal", "requestingPageTitle": "Preview", "requestingPageURL": "https://dash11.comm100.io/frontEnd/assets/livechat/previewpage/?campaignId=bd8fc603-6d63-49e2-b594-db015c221b40&siteId=10000&q=1619509862473", "preChatSocialMediaSource": 0, "preChatSocialProfileURL": "", "preChatName": "1", "preChatEmail": "1@1.com", "preChatProductService": "", "preChatPhone": "", "preChatCompany": "", "preChatTicketId": -1, "departmentId": "00000000-0000-0000-0000-000000000000", "skillId": "00000000-0000-0000-0000-000000000000", "requestedTime": "2021-04-27T08:36:27.8333333Z", "offlineMessageId": 0, "avgResponseTime": 14.0, "visitorMessagesCount": 5, "agentMessagesCount": 8, "campaignId": "bd8fc603-6d63-49e2-b594-db015c221b40", "lastMessageSentBy": "agent", "duration": "00:00:37", "source": "chatButton", "waitingTime": "00:00:00", "autoInvitationId": "00000000-0000-0000-0000-000000000000", "botDuration": "00:00:00", "agentDuration": "00:00:37", "botId": "00000000-0000-0000-0000-000000000000", "chatType": "agentOnly", "messages": [ { "chatAction": "agentAcceptChat", "message": "Agent may1 may has joined the chat.", "senderType": "system", "senderName": "", "time": "2021-04-27T08:36:28Z", "translatedMessage": "", "attachment": "" }, { "chatAction": "visitorAddTextMessage", "message": "12312", "senderType": "visitor", "senderName": "1", "time": "2021-04-27T08:36:34Z", "translatedMessage": "", "attachment": "" }, { "chatAction": "visitorAddTextMessage", "message": "3123", "senderType": "visitor", "senderName": "1", "time": "2021-04-27T08:36:35Z", "translatedMessage": "", "attachment": "" }, { "chatAction": "visitorAddTextMessage", "message": "1", "senderType": "visitor", "senderName": "1", "time": "2021-04-27T08:36:35Z", "translatedMessage": "", "attachment": "" }, { "chatAction": "visitorAddTextMessage", "message": "2", "senderType": "visitor", "senderName": "1", "time": "2021-04-27T08:36:35Z", "translatedMessage": "", "attachment": "" }, { "chatAction": "visitorAddTextMessage", "message": "3", "senderType": "visitor", "senderName": "1", "time": "2021-04-27T08:36:35Z", "translatedMessage": "", "attachment": "" }, { "chatAction": "agentSendText", "message": "1123", "senderType": "agent", "senderName": "may1 may", "time": "2021-04-27T08:36:48Z", "translatedMessage": "", "attachment": "" }, { "chatAction": "agentSendText", "message": "1", "senderType": "agent", "senderName": "may1 may", "time": "2021-04-27T08:36:48Z", "translatedMessage": "", "attachment": "" }, { "chatAction": "agentSendText", "message": "3", "senderType": "agent", "senderName": "may1 may", "time": "2021-04-27T08:36:49Z", "translatedMessage": "", "attachment": "" }, { "chatAction": "agentSendText", "message": "12", "senderType": "agent", "senderName": "may1 may", "time": "2021-04-27T08:36:49Z", "translatedMessage": "", "attachment": "" }, { "chatAction": "agentSendText", "message": "312", "senderType": "agent", "senderName": "may1 may", "time": "2021-04-27T08:36:49Z", "translatedMessage": "", "attachment": "" }, { "chatAction": "agentSendNoteText", "message": "123", "senderType": "agent", "senderName": "may1 may", "time": "2021-04-27T08:36:52Z", "translatedMessage": "", "attachment": "" }, { "chatAction": "agentSendNoteText", "message": "123", "senderType": "agent", "senderName": "may1 may", "time": "2021-04-27T08:36:52Z", "translatedMessage": "", "attachment": "" }, { "chatAction": "agentSendNoteText", "message": "213", "senderType": "agent", "senderName": "may1 may", "time": "2021-04-27T08:36:53Z", "translatedMessage": "", "attachment": "" }, { "chatAction": "agentSendText", "message": "123", "senderType": "agent", "senderName": "may1 may", "time": "2021-04-27T08:37:00Z", "translatedMessage": "", "attachment": "" }, { "chatAction": "agentSendNoteFile", "message": "Agent may1 may has sent a file: Chats_20210305 (3).csv", "senderType": "agent", "senderName": "https://api11.comm100.io/FileService/v1/files/O3A-0OGU4YfeDSfxx18KSW47USwMn320HQE7jYN15mq0HfqkyAW3_n-JR1FWRhJjoUqXD2arP7osQvkWOBklHguXo5B867K7Mgi9u-Aqn3fW7GoouxmtGezbRHQu4Y8g4iazi-JVtVnBip_KPLdijL3iNmA_lCvn57ClwTsnQWfQ?Chats_20210305 (3).csv?may1 may", "time": "2021-04-27T08:37:01Z", "translatedMessage": "", "attachment": "O3A-0OGU4YfeDSfxx18KSW47USwMn320HQE7jYN15mq0HfqkyAW3_n-JR1FWRhJjoUqXD2arP7osQvkWOBklHguXo5B867K7Mgi9u-Aqn3fW7GoouxmtGezbRHQu4Y8g4iazi-JVtVnBip_KPLdijL3iNmA_lCvn57ClwTsnQWfQ" }, { "chatAction": "agentSendText", "message": "123", "senderType": "agent", "senderName": "may1 may", "time": "2021-04-27T08:37:01Z", "translatedMessage": "", "attachment": "" }, { "chatAction": "agentSendText", "message": "123", "senderType": "agent", "senderName": "may1 may", "time": "2021-04-27T08:37:02Z", "translatedMessage": "", "attachment": "" }, { "chatAction": "agentEndChat", "message": "Agent may1 may has left the chat.", "senderType": "agent", "senderName": "", "time": "2021-04-27T08:37:06Z", "translatedMessage": "", "attachment": "" }, { "chatAction": "systemEndChat", "message": "The chat is ended.", "senderType": "system", "senderName": "", "time": "2021-04-27T08:37:06Z", "translatedMessage": "", "attachment": "" } ], "session": { "id": "2db8f0e0-b040-46fb-821d-4e45149ac03e", "visitorId": "e11203f5-1d97-4c48-8fc2-fc6257d4e13b", "contactIdentityId": "00000000-0000-0000-0000-000000000000", "ip": "192.168.2.128", "referrerURL": "https://dash11.comm100.io/frontEnd/assets/livechat/previewpage/?campaignId=bd8fc603-6d63-49e2-b594-db015c221b40&siteId=10000", "searchEngineId": "00000001-0000-0000-0000-000000000001", "keywords": "", "landingPageURL": "https://dash11.comm100.io/frontEnd/assets/livechat/previewpage/?campaignId=bd8fc603-6d63-49e2-b594-db015c221b40&siteId=10000&q=1619509862473", "landingPageTitle": "", "startTime": "2021-04-27T08:36:25.8Z", "browser": "Google Chrome 86.0.4240.75", "operatorSystem": "Windows 8.1", "screenResolution": "1680x1050", "language": "zh-CN", "timeZone": "-480" } }, { "id": 4875, "guid": "2efc01b2-b7c1-40a9-b049-b0db9fbc4dbc", "sessionId": "f8383a83-48e9-4d0d-a3bd-fb19ce5c12db", "visitorId": "e11203f5-1d97-4c48-8fc2-fc6257d4e13b", "contactIdentityId": "00000000-0000-0000-0000-000000000000", "startTime": "2021-04-27T07:50:28.753Z", "endTime": "2021-04-27T08:01:29.003Z", "status": "normal", "requestingPageTitle": "Preview", "requestingPageURL": "https://dash11.comm100.io/frontEnd/assets/livechat/previewpage/?campaignId=bd8fc603-6d63-49e2-b594-db015c221b40&siteId=10000&q=1619509862473", "preChatSocialMediaSource": 0, "preChatSocialProfileURL": "", "preChatName": "1", "preChatEmail": "1@1.com", "preChatProductService": "", "preChatPhone": "", "preChatCompany": "", "preChatTicketId": -1, "departmentId": "00000000-0000-0000-0000-000000000000", "skillId": "00000000-0000-0000-0000-000000000000", "requestedTime": "2021-04-27T07:50:28.7533333Z", "offlineMessageId": 0, "avgResponseTime": 6.0, "visitorMessagesCount": 1, "agentMessagesCount": 4, "campaignId": "bd8fc603-6d63-49e2-b594-db015c221b40", "lastMessageSentBy": "agent", "duration": "00:11:00", "source": "chatButton", "waitingTime": "00:00:00", "autoInvitationId": "00000000-0000-0000-0000-000000000000", "botDuration": "00:00:00", "agentDuration": "00:11:00", "botId": "00000000-0000-0000-0000-000000000000", "chatType": "agentOnly", "messages": [ { "chatAction": "agentAcceptChat", "message": "Agent may1 may has joined the chat.", "senderType": "system", "senderName": "", "time": "2021-04-27T07:50:29Z", "translatedMessage": "", "attachment": "" }, { "chatAction": "visitorAddTextMessage", "message": "13", "senderType": "visitor", "senderName": "1", "time": "2021-04-27T08:00:15Z", "translatedMessage": "", "attachment": "" }, { "chatAction": "agentSendText", "message": "123", "senderType": "agent", "senderName": "may1 may", "time": "2021-04-27T08:00:21Z", "translatedMessage": "", "attachment": "" }, { "chatAction": "agentSendText", "message": "1223", "senderType": "agent", "senderName": "may1 may", "time": "2021-04-27T08:00:23Z", "translatedMessage": "", "attachment": "" }, { "chatAction": "agentSendNoteText", "message": "hello", "senderType": "agent", "senderName": "may1 may", "time": "2021-04-27T08:01:01Z", "translatedMessage": "", "attachment": "" }, { "chatAction": "agentSendNoteText", "message": "hello", "senderType": "agent", "senderName": "may1 may", "time": "2021-04-27T08:01:03Z", "translatedMessage": "", "attachment": "" }, { "chatAction": "agentSendText", "message": "12321", "senderType": "agent", "senderName": "may1 may", "time": "2021-04-27T08:01:12Z", "translatedMessage": "", "attachment": "" }, { "chatAction": "agentSendNoteFile", "message": "Agent may1 may has sent a file: Chats_20210305 (5).csv", "senderType": "agent", "senderName": "https://api11.comm100.io/FileService/v1/files/H7UXY7FigsxUUInQBoKTqn4QYq9yanARl5jD2iZzSD-ZZQm_A4X_QhFkvatVYg9ljsmPfllZ6LAF0JkxfJoiSAqko0HU35tUkKqTJlmltzUAb2-scyNlY7Z7EvRyJsYpDZIOgscGydXov-X3zJ6vtzB51_fEGdnrEhbrBXwI9pww?Chats_20210305 (5).csv?may1 may", "time": "2021-04-27T08:01:20Z", "translatedMessage": "", "attachment": "H7UXY7FigsxUUInQBoKTqn4QYq9yanARl5jD2iZzSD-ZZQm_A4X_QhFkvatVYg9ljsmPfllZ6LAF0JkxfJoiSAqko0HU35tUkKqTJlmltzUAb2-scyNlY7Z7EvRyJsYpDZIOgscGydXov-X3zJ6vtzB51_fEGdnrEhbrBXwI9pww" }, { "chatAction": "agentSendText", "message": "31232312", "senderType": "agent", "senderName": "may1 may", "time": "2021-04-27T08:01:23Z", "translatedMessage": "", "attachment": "" }, { "chatAction": "agentEndChat", "message": "Agent may1 may has left the chat.", "senderType": "agent", "senderName": "", "time": "2021-04-27T08:01:29Z", "translatedMessage": "", "attachment": "" }, { "chatAction": "systemEndChat", "message": "The chat is ended.", "senderType": "system", "senderName": "", "time": "2021-04-27T08:01:29Z", "translatedMessage": "", "attachment": "" } ], "session": { "id": "f8383a83-48e9-4d0d-a3bd-fb19ce5c12db", "visitorId": "e11203f5-1d97-4c48-8fc2-fc6257d4e13b", "contactIdentityId": "00000000-0000-0000-0000-000000000000", "ip": "192.168.2.128", "referrerURL": "https://dash11.comm100.io/frontEnd/assets/livechat/previewpage/?campaignId=bd8fc603-6d63-49e2-b594-db015c221b40&siteId=10000", "searchEngineId": "00000001-0000-0000-0000-000000000001", "keywords": "", "landingPageURL": "https://dash11.comm100.io/frontEnd/assets/livechat/previewpage/?campaignId=bd8fc603-6d63-49e2-b594-db015c221b40&siteId=10000&q=1619509862473", "landingPageTitle": "", "startTime": "2021-04-27T07:50:25.41Z", "browser": "Google Chrome 86.0.4240.75", "operatorSystem": "Windows 8.1", "screenResolution": "1680x1050", "language": "zh-CN", "timeZone": "-480" } } ], "pageIndex": 0, "pageSize": 50 } ``` ### Search Missed & Refused Chats `POST livechat/missedAndRefusedChats:Search` - #### Parameters: | Name | Type | in | Required | Description | | --- | --- | --- | --- | --- | | `include` | string | query | no | Available values for Include are: "campaign", "chatAgent", "chatWrapupCategory", "contactIdentity", "department", "skill". | | `pageSize` | integer | query | no | Page size. | | `pageIndex` | integer | query | no | Page index. | | `filters` | array | body | no | Filter array. Available items are: requestedTime, departmentId, skillId, status, campaignId, segmentId. | - #### Response: An array of [Chat](/docs/server-api-livechat-chat#chat-json-format) - #### Example Sample Request: ``` curl https://api11.comm100.io/v4/livechat/missedAndRefusedChats:search?pageIndex=1&pageSize=50 \ -X 'POST' \ -H 'Authorization: Bearer {access_token}' \ -H 'Content-Type: application/json' \ -D '{"filters":[{"name":"requestedTime","operator":"is","value":["2021-04-21T00:00:00-07:00","2021-05-06T00:00:00-07:00"]}]}' ``` Response: HTTP/1.1 200 OK ``` { "total": 1, "pageCount": 1, "list": [ { "id": 3868, "guid": "1715e7d4-bbab-4abd-8e45-65a36995fd4b", "sessionId": "0a98bc2f-4b31-4928-b537-c8c06cc345d0", "visitorId": "178abc2f-5e4c-43ef-9ddd-a94f054b9380", "contactIdentityId": "00000000-0000-0000-0000-000000000000", "startTime": "2021-04-21T09:03:59.13Z", "endTime": "2021-04-21T09:50:36.88Z", "status": "missed", "requestingPageTitle": "Preview", "requestingPageURL": "https://dash11.comm100.io/frontEnd/assets/livechat/previewpage/?campaignId=8586fecc-312e-46cb-b1a6-9e9c68c0276f&siteId=10000&q=1618995815097", "preChatSocialMediaSource": 0, "preChatSocialProfileURL": "", "preChatName": "192.168.2.128", "preChatEmail": "", "preChatProductService": "", "preChatPhone": "", "preChatCompany": "", "preChatTicketId": -1, "departmentId": "45bc6136-1652-4eba-b27f-5d9b42f997fe", "skillId": "00000000-0000-0000-0000-000000000000", "requestedTime": "2021-04-21T09:03:59.13Z", "offlineMessageId": 0, "avgResponseTime": 0.0, "visitorMessagesCount": 0, "agentMessagesCount": 0, "campaignId": "8586fecc-312e-46cb-b1a6-9e9c68c0276f", "lastMessageSentBy": "system", "duration": "00:00:00", "source": "chatButton", "waitingTime": "00:46:37", "autoInvitationId": "00000000-0000-0000-0000-000000000000", "botDuration": "00:00:00", "agentDuration": "00:00:00", "botId": "00000000-0000-0000-0000-000000000000", "chatType": "agentOnly", "messages": [ { "chatAction": "systemPromoteOfflineMesage", "message": "If you do not want to wait, please click here to leave us a message.", "senderType": "system", "senderName": "", "time": "2021-04-21T09:04:01Z", "translatedMessage": "", "attachment": "" } ], "session": { "id": "0a98bc2f-4b31-4928-b537-c8c06cc345d0", "visitorId": "178abc2f-5e4c-43ef-9ddd-a94f054b9380", "contactIdentityId": "00000000-0000-0000-0000-000000000000", "ip": "192.168.2.128", "referrerURL": "", "searchEngineId": "00000001-0000-0000-0000-000000000001", "keywords": "", "landingPageURL": "https://dash11.comm100.io/frontEnd/assets/livechat/previewpage/?campaignId=8586fecc-312e-46cb-b1a6-9e9c68c0276f&siteId=10000&q=1618995815097", "landingPageTitle": "", "startTime": "2021-04-21T09:03:48.8166667Z", "browser": "Google Chrome 59.0.3071.115", "operatorSystem": "Windows 8.1", "screenResolution": "1920x1080", "language": "en-US", "timeZone": "-480" } } ], "pageIndex": 0, "pageSize": 50 } ``` ### Update the Chat Ticket `PUT livechat/chats/{id}` - #### Parameters: | Name | Type | in | Required | Description | | --- | --- | --- | --- | --- | | `preChatTicketId` | integer | body | yes | Id of the ticket to which this chat is attached. | | `id` | integer | query | yes | Id of the chat. | - #### Response: [Chat](/docs/server-api-livechat-chat#chat-json-format) - #### Example Sample Request: ``` curl https://api11.comm100.io/v4/livechat/chats/1 \ -X 'PUT' \ -H 'Authorization: Bearer {access_token}' \ -H 'Content-Type: application/json' \ -D '{"preChatTicketId":2234}' ``` Response: HTTP/1.1 200 OK ``` { "id": 1, "sessionId": "F3B25329-7C46-EB11-8100-00155D081D0B", "startTime": "2021-04-28T09:15:01.71Z", "endTime": "2021-04-28T09:18:01.71Z", "isQueued": false, "ifAudioChatHappened": false, "ifVideoChatHappened": false, "status": "normal", "messages": "[ { \"chatAction\": \"agentAcceptChat\", \"message\": \"Agent may1 may has joined the chat.\", \"senderType\": \"system\", \"senderName\": \"\", \"time\": \"2021-04-27T08:52:05Z\", \"translatedMessage\": \"\", \"attachment\": \"\" }, { \"chatAction\": \"agentEndChat\", \"message\": \"Agent may1 may has left the chat.\", \"senderType\": \"agent\", \"senderName\": \"\", \"time\": \"2021-04-27T08:59:31Z\", \"translatedMessage\": \"\", \"attachment\": \"\" }, { \"chatAction\": \"systemEndChat\", \"message\": \"The chat is ended.\", \"senderType\": \"system\", \"senderName\": \"\", \"time\": \"2021-04-27T08:59:31Z\", \"translatedMessage\": \"\", \"attachment\": \"\" } ]", "requestingPageTitle": "", "requestingPageURL": "", "source": "chatButton", "autoInvitationId": "FEB25329-7C46-EB11-8100-00155D081D0B", "preChatSocialMediaSource": "none", "preChatSocialProfileURL": "", "preChatName": "Jason", "preChatEmail": "jason@comm100.com", "preChatPhone": "1234567890", "preChatCompany": "Comm1000", "preChatProductService": "product 1", "preChatTicketId": 2234, "departmentId": "00000000-0000-0000-0000-000000000000", "skillId": "00000000-0000-0000-0000-000000000000", "requestedTime": "2021-04-28T09:14:37.3366667Z", "avgResponseTime": 50, "visitorMessagesCount": 10, "agentMessagesCount": 10, "campaignId": "0DB35329-7C46-EB11-8100-00155D081D0B", "waitingTime": 0, "duration": 0, "cannedMessageCount": 0, "botDuration": 0, "agentDuration": 0, "lastMessageSentBy": "0", "botId": "14B35329-7C46-EB11-8100-00155D081D0B", "guid": "C2B35329-7C46-EB11-8100-00155D081D0B", "visitorId": "E6B35329-7C46-EB11-8100-00155D081D0B", "contactIdentityId": "EEB35329-7C46-EB11-8100-00155D081D0B", "chatAgents": [ { "chatId": "82DF661D-5F9F-4E2E-B694-23957239051E", "agentId": "5D32C07E-5348-49B8-8D58-0DCEAD683712", "startTime": "2021-04-28", "endTime": "2021-04-29", "duration": 5, "id": 1 } ] } ``` ### Batch Delete Chats `DELETE livechat/chats` - #### Parameters: | Name | Type | in | Required | Description | | --- | --- | --- | --- | --- | | `Request body` | json string | body | yes | Integer Id array of the chats. | - #### Response: No Content - #### Example Sample Request: ``` curl https://api11.comm100.io/v4/livechat/chats \ -X 'DELETE' \ -H 'Authorization: Bearer {access_token}' \ -D '[3867,3862,3861]' ``` Response: HTTP/1.1 200 OK ### Delete a single Chat `DELETE livechat/chats/{id}` - #### Parameters: | Name | Type | in | Required | Description | | --- | --- | --- | --- | --- | | `id` | integer | path | yes | Integer Id of the chat. | - #### Response: No Content - #### Example Sample Request: ``` curl https://api11.comm100.io/v4/livechat/chats/1 \ -X 'DELETE' \ -H 'Authorization: Bearer {access_token}' \ ``` Response: HTTP/1.1 204 No Content ### Chat Wrapup Category JSON Format Chat Wrapup Category is represented as simple flat JSON objects with the following keys: | Name | Type | Description | | --- | --- | --- | | `chatId` | integer | Id of the chat which the wrap-up category belongs to. | | `categoryOptionId` | guid | Id of the category option which the wrap-up category belongs to. | | `id` | selfIncrementId | Id of the chat wrap-up category. | ### Get the list of Chat Wrapup Categories `GET livechat/chatWrapupCategories` - #### Parameters: No Parameters - #### Response: An array of [Chat Wrapup Category](/docs/server-api-livechat-chat#chat-wrapup-category-json-format) - #### Example Sample Request: ``` curl https://api11.comm100.io/v4/livechat/chatWrapupCategories \ -X 'GET' \ -H 'Authorization: Bearer {access_token}' \ ``` Response: HTTP/1.1 200 OK ``` [ { "chatId": "9B5FBC95-DEE1-4D0A-B75F-DB06B602F3A3", "categoryOptionId": "9549C2C8-23DC-4DAB-87FF-5A0790A4301B", "id": 1 } ] ``` ### Get a single Chat Wrapup Category `GET livechat/chatWrapupCategories/{id}` - #### Parameters: No Parameters - #### Response: [Chat Wrapup Category](/docs/server-api-livechat-chat#chat-wrapup-category-json-format) - #### Example Sample Request: ``` curl https://api11.comm100.io/v4/livechat/chatWrapupCategories/1 \ -X 'GET' \ -H 'Authorization: Bearer {access_token}' \ ``` Response: HTTP/1.1 200 OK ``` { "chatId": "9B5FBC95-DEE1-4D0A-B75F-DB06B602F3A3", "categoryOptionId": "9549C2C8-23DC-4DAB-87FF-5A0790A4301B", "id": 1 } ``` ### Update Chat Wrapup Category `POST livechat/chats/{id}/ChatWrapupCategories` - #### Parameters: | Name | Type | in | Required | Description | | --- | --- | --- | --- | --- | | `categoryOptionId` | guid | body | yes | Id of the Category Option which the Chat Wrapup Category belongs to | | `id` | guid | body | yes | Chat guid of the Chat which the Chat Wrapup Category belongs to | - #### Response: No Content - #### Example Sample Request: ``` curl https://api11.comm100.io/v4/livechat/chats/84d76adc-83f4-42c9-b06d-1b617076a3a7/chatWrapupCategories \ -X 'POST' \ -H 'Authorization: Bearer {access_token}' \ -H 'Content-Type: application/json' \ -D '{"categoryOptionId": "3fa85f64-5717-4562-b3fc-2c963f66afa6"}' ``` Response: HTTP/1.1 200 OK ### Chat Wrap-up JSON Format Chat Wrap-up is represented as simple flat JSON objects with the following keys: | Name | Type | Description | | --- | --- | --- | | `chatId` | integer | Id of the chat. | | `agentId` | guid | Id of the agent. | | `comment` | string | Comment of the wrap-up. | | `isAutoSubmitted` | bool | If the wrap-up is automatically submitted by Smart Wrap-up of Agent Assist, the value is True. | | `lastUpdatedTime` | timestamp | Last updated time of the warp-up. | ### Update the Chat Wrapup `PUT livechat/chats/{id}/chatWrapup` - #### Parameters: | Name | Type | in | Required | Description | | --- | --- | --- | --- | --- | | `comment` | string | body | yes | Comment of the wrap-up. | - #### Response: [Chat Wrap-up](/docs/server-api-livechat-chat#chat-wrap-up-json-format) - #### Example Sample Request: ``` curl https://api11.comm100.io/v4/livechat/chats/12/chatWrapup \ -X 'PUT' \ -H 'Authorization: Bearer {access_token}' \ -H 'Content-Type: application/json' \ -D '{"comment":""}' ``` Response: HTTP/1.1 200 OK ``` { "chatId": 12, "agentId": "1AB35329-7C46-EB11-8100-00155D081D0B", "comment": "", "lastUpdatedTime": "2021-04-28T09:14:37.3366667Z" } ``` ### Update Chat Wrapup Field Results `POST livechat/chatFieldResults` - #### Parameters: An array of chat field results | Name | Type | in | Required | Description | | --- | --- | --- | --- | --- | | `chatId` | int | body | yes | Id of the chat which the chat field result belongs to. | | `fieldName` | string | body | no | Filed name of the chat field result. | | `value` | string | body | yes | Value of the chat field result. | | `fieldId` | guid | body | yes | Id of the field which the chat field result belongs to. | | `formType` | string | body | no | Form field type of the chat field result,only allowed "wrapup" | - #### Response: No Content - #### Example Sample Request: ``` curl https://api11.comm100.io/v4/livechat/chatFieldResults \ -X 'POST' \ -H 'Authorization: Bearer {access_token}' \ -H 'Content-Type: application/json' \ -D '[{ "formType": "wrapup", "fieldId": "d983d5c6-15cc-4ad1-ba2a-12e77b337566", "fieldName": "Temporary field", "value": "yes", "chatId": 11 }]' ``` Response: HTTP/1.1 200 OK