Chat

Chats
- Chats Manage
GET livechat/chats/{id}
POST livechat/chats:Search
POST livechat/chats/{id}:AttachToTicket
POST livechat/missedAndRefusedChats:Search
PUT livechat/chats/{id}
DELETE livechat/chats
DELETE livechat/chats/{id}
Chat Wrapup Categories
- Chat Wrapup Categories Manage
GET livechat/chatWrapupCategories
GET livechat/chatWrapupCategories/{id}
POST livechat/ChatWrapupCategories
Chat Field Results
- Chat Field Results Manage
POST livechat/chatFieldResults
Model
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 "normal", "refused", "missed", "switchedToMessage".
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 "chatButton", "autoInvitation", "manualInvitation".
autoInvitationId guid Id of the auto invitation.
preChatSocialMediaSource string Allowed values are "none", "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.
requestedTime datetime The time when the chat is requested.
avgResponseTime integer 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 "visitor", "agent", "chatBot", "system".
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.

Chat Wrap-up JSON Format:

Name Type Description
chatId integer Id of the chat.
agentId guid Id of the agent.
comment string Comment of the wrap-up.
lastUpdatedTime timestamp Last updated time of the warp-up.

Chat Segment Result JSON Format:

Name Type Description
id integer Id of the chat segment result.
chatId integer Id of the chat.
segmentId guid Id of the segment.
logTime datetime Time of the chat segment result.

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.
Endpoint
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", "chatAttachment", "chatFieldResult", "chatSegmentResult", "chatWrapup", "chatWrapupCategory", "contactIdentity", "department", "postChatSurvey", "session", "visitor".
id int or guid path yes Id of the chat or Guid of the chat.
Response:
Example

Sample Request:

curl https://api15.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","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://autoapi.comm100dev.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":""}]}
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", "visitor".
pageIndex integer query no Page index.
filters array body no Filter array. Available items are: requestedTime, departmentId, agent, botId, categoryOptionId, keywords and other custom filters.
name operator
requestedTime is
departmentId is
agent is
botId is
categoryOptionId is
keywords is
Campaign is one of/is not one of/contains/not contains/regular expression
Duration is/is more than/is less than
Name contains/not contains
Email contains/not contains
Phone contains/not contains
Company contains/not contains
Produce Service is/is not
Chat ID is/is not
Chat Type is/is not
Rating is/is not/is not empty/is empty
Rating Comment contains/not contains/is not empty/is empty
Agent Comment contains/not contains
Segment is/is not
Transferred-out Department is/is not
Transferred-in Department is/is not
Transferred is/is not
SSO User ID is
Last Message Sent by is/is not
Other custom filter, allowed values are all fields of chat, pre-chat, post-chat, wrap-up, custom variable, e.g., preChatEmail. Allowed values are "is", "contains", "notContains", "isMoreThan", "isLessThan", "isNot", "isNotLessThan", "isNotMoreThan", "regularExpression", "isOneOf", "isNotIn", e.g., contains. Input value for this filter, e.g., ["test keyword"].
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

Example

Sample Request:

curl https://api15.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":"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","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","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","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://autoapi.comm100dev.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","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://autoapi.comm100dev.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}
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 yes UTC Offset of the user.
targetId integer body yes Id of the ticket to which this chat is attached.
dateTimeFormat string body yes Datetime format of the user.
Response:

No Content

Example

Sample Request:

curl https://api15.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 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".
pageSize integer query no Page size.
pageIndex integer query no Page index.
filters array body no Filter array. Available items are: requestedTime, departmentId, status, campaignId, segmentId.
Response:

An array of   Chat

Example

Sample Request:

curl https://api15.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","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

PUT livechat/chats/{id}

Parameters:

Name Type In Required Description
preChatTicketId integer body yes Id of the ticket to which this chat is attached.
Response:
Example

Sample Request:

curl https://api15.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", "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 Id array of the chats.
Response:

No Content

Example

Sample Request:

curl https://api15.comm100.io/v4/livechat/chats \
-X 'DELETE' \
-H 'Authorization: Bearer {access_token}' \
-D '[3867,3862,3861]'

Response:

 HTTP/1.1 200 OK

Remove the Chat

DELETE livechat/chats/{id}

Parameters:

Name Type In Required Description
id int path yes Id of the chat.
Response:

No Content

Example

Sample Request:

curl https://api15.comm100.io/v4/livechat/chats/1 \
-X 'DELETE' \
-H 'Authorization: Bearer {access_token}' \

Response:

 HTTP/1.1 204 No Content

Model
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.
Endpoint
Get the list of Chat Wrapup Categories

GET livechat/chatWrapupCategories

Parameters:
No Parameters
Response:

An array of   Chat Wrapup Category

Example

Sample Request:

curl https://api15.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:
Example

Sample Request:

curl https://api15.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}
Chat Wrapup Category

POST livechat/ChatWrapupCategories

Parameters:

Name Type In Required Description
categoryOptionId guid body yes Id of the Category Option which the Chat Wrapup Category belongs to
chatId integer body yes Id of the Chat which the Chat Wrapup Category belongs to
Response:

No Content

Example

Sample Request:

curl https://api15.comm100.io/v4/livechat/chatWrapupCategories \
-X 'POST' \
-H 'Authorization: Bearer {access_token}' \
-H 'Content-Type: application/json' \
-D '{"chatId": 10,"categoryOptionId": "3fa85f64-5717-4562-b3fc-2c963f66afa6"}'

Response:

 HTTP/1.1 200 OK

Model
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.
Endpoint
Chat Field Result

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.
label string body no Label of the chat field result.
fieldName string body no Value of the chat field result.
fieldId guid body yes Id of the field which the chat field result belongs to.
value string body no Value of the chat field result.
url string body no Url of the chat field result.
order int body no Order of the chat field result.
formType string body no Form field type of the chat field result.
Response:

No Content

Example

Sample Request:

curl https://api15.comm100.io/v4/livechat/chatFieldResults \
-X 'POST' \
-H 'Authorization: Bearer {access_token}' \
-H 'Content-Type: application/json' \
-D '[{ "formType": 0, "fieldId": "3fa85f64-5717-4562-b3fc-2c963f66afa6", "fieldName": "Temporary field", "value": "value", "url": "http://www.google.com", "label": "label", "order": 0, "chatId": 11 }}]'

Response:

 HTTP/1.1 200 OK