Chat Server

Chat Server
- Chat Server Manage
GET livechat/agents
GET livechat/agents/{id}
PUT livechat/agents/{id}
GET livechat/visitors
GET livechat/visitors/{id}
PUT livechat/visitors/{id}
Endpoint
Get the list of agents' status

GET livechat/agents

Parameters:

No Parameters
Response:

An array of agents' staus

Name Type Description
ongoingChats int The ongoing chats number of the agent.
status string Name of the status.
id guid Id of the agent.
Example

Sample Request:

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

Response:

 HTTP/1.1 200 OK

[ { "id": "c97a2afe-a38f-46f8-a55b-8ac9f873cd09", "status": "Online", "ongoingChats": 0 }]
Get an agent's status

GET livechat/agents/{id}

Parameters:

No Parameters
Response:

Name Type Description
id guid Id of the agent.
status string Name of the status.
ongoingChats int The ongoing chats number of the agent.
Example

Sample Request:

curl https://api15.comm100.io/v4/livechat/agents/c97a2afe-a38f-46f8-a55b-8ac9f873cd09 \
-X 'GET' \
-H 'Authorization: Bearer {access_token}' \

Response:

 HTTP/1.1 200 OK

{ "id": "c97a2afe-a38f-46f8-a55b-8ac9f873cd09", "status": "Online", "ongoingChats": 0 }
Update an agent's status

PUT livechat/agents/{id}

Parameters:

Name Type In Required Description
status string body yes Allowed values are "online","away" and other custom away status if enabled.
Response:

Name Type Description
id guid Id of the agent.
status string Name of the status.
ongoingChats int The ongoing chats number of the agent.
Example

Sample Request:

curl https://api15.comm100.io/v4/livechat/agents/c97a2afe-a38f-46f8-a55b-8ac9f873cd09 \
-X 'PUT' \
-H 'Authorization: Bearer {access_token}' \
-H 'Content-Type: application/json' \
-D '{ "id": "c97a2afe-a38f-46f8-a55b-8ac9f873cd09", "status": "Meeting" }'

Response:

 HTTP/1.1 200 OK

{ "id": "c97a2afe-a38f-46f8-a55b-8ac9f873cd09", "status": "Meeting", "ongoingChats": 0 }
Get the list of visitors'info

GET livechat/visitors

Parameters:

No Parameters
Response:

An array of visitors' info

Name Type Description
language string Language of the visitor used.
phone string Phone of the visitor.
name string Name of the visitor.
pageViews int Page view count of the visitor.
flashVersion string Flash version of the visitor used.
company string Company of the visitor.
timeZone string Timezone of the visitor.
browser string Browser of the visitor used.
customFields FieldAndValue[] Field and value array.
name Description
name Name of the field.
value Value of the field.
url Url of the field.
referrerUrl string Referrer Url of the visitor.
email string Email of the visitor.
visits int Visit count of the visitor.
landingPage string Landing page of the visit.
operatingSystem string Operating system of the visitor used.
screenResolution string Screen resolution of the visitor used.
searchEngine string Search engine of the visit.
visitTime datetime Visit time of the visitor.
id guid Id of the visitor.
firstVisitTime datetime First visit time of the visitor.
city string City of the visitor.
currentBrowsing string Current browsing of the visitor.
departmentId guid Department id of the visit.
searchKeywords string Search keywords of the visit.
ip string IP of the visitor.
chats int Chat count of the visitor.
status string Allowed values are "waitingForChat", "voiceChatting","chatting","preChat","manuallyInvited","autoInvited","offlineMessage","refusedByOperator","refusedByVisitor","chatEnded","inSite","outOfSite","transferring","manuallyInvitedByWindow","systemProcessing".
customVariableResults FieldAndValue[] Field and value array.
name Description
name Name of the custom variable.
value Value of the custom variable.
url Url of the custom variable.
productService string Product service of the visitor.
country string Country of the visitor.
state string State of the visitor.
Example

Sample Request:

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

Response:

 HTTP/1.1 200 OK

[ { "id": "3d59f909-24cd-43bc-89cb-00a320617c0a", "status": "inSite", "browser": "Google Chrome 86.0.4240.75", "operatingSystem": "Windows 8.1", "screenResolution": "1680x1050", "language": "en-US", "ip": "192.168.2.128", "country": "China", "state": "Zhejiang", "city": "Hangzhou", "timeZone": "GMT +08:00", "visitTime": "2021-05-26T10:30:16.036Z", "firstVisitTime": "2021-05-26T10:31:29.597Z", "visits": 1, "chats": 0, "pageViews": 1, "currentBrowsing": "https://dash15.comm100.io/frontEnd/assets/livechat/previewpage/?campaignId=22f0b296-69e9-4b81-abe4-4bb9ed5ec9ef&siteId=10000&q=1622025088751", "referrerUrl": "https://dash15.comm100.io/frontEnd/assets/livechat/previewpage/?campaignId=22f0b296-69e9-4b81-abe4-4bb9ed5ec9ef&siteId=10000", "name": "192.168.2.128", "email": "123@comm100.com", "phone": "1234567890123", "company": "comm", "productService": "LA", "departmentId": "00000000-0000-0000-0000-000000000000", "searchEngine": "Google", "searchKeywords": "com", "landingPage": "https://dash15.comm100.io/frontEnd/assets/livechat/previewpage/?campaignId=22f0b296-69e9-4b81-abe4-4bb9ed5ec9ef&siteId=10000&q=1622025088751", "customFields": [], "customVariableResults": [ { "name": "CARLZHOU222SHENTI", "value": "11123123123", "url": "" }, { "name": "fccc", "value": "520", "url": "" } ] }]
Get a visitor's info

GET livechat/visitors/{id}

Parameters:

No Parameters
Response:

Name Type Description
browser string Browser of the visitor used.
chats int Chat count of the visitor.
landingPage string Landing page of the visit.
screenResolution string Screen resolution of the visitor used.
searchEngine string Search engine of the visit.
status string Allowed values are "waitingForChat", "voiceChatting","chatting","preChat","manuallyInvited","autoInvited","offlineMessage","refusedByOperator","refusedByVisitor","chatEnded","inSite","outOfSite","transferring","manuallyInvitedByWindow","systemProcessing".
visitTime datetime Visit time of the visitor.
language string Language of the visitor used.
phone string Phone of the visitor.
name string Name of the visitor.
searchKeywords string Search keywords of the visit.
visits int Visit count of the visitor.
referrerUrl string Referrer Url of the visitor.
pageViews int Page view count of the visitor.
flashVersion string Flash version of the visitor used.
departmentId guid Department id of the visit.
customFields FieldAndValue[] Field and value array.
name Description
name Name of the field.
value Value of the field.
url Url of the field.
ip string IP of the visitor.
operatingSystem string Operating system of the visitor used.
city string City of the visitor.
state string State of the visitor.
email string Email of the visitor.
id guid Id of the visitor.
country string Country of the visitor.
productService string Product service of the visitor.
firstVisitTime datetime First visit time of the visitor.
timeZone string Timezone of the visitor.
currentBrowsing string Current browsing of the visitor.
customVariableResults FieldAndValue[] Field and value array.
name Description
name Name of the custom variable.
value Value of the custom variable.
url Url of the custom variable.
company string Company of the visitor.
Example

Sample Request:

curl https://api15.comm100.io/v4/livechat/visitors/3d59f909-24cd-43bc-89cb-00a320617c0a \
-X 'GET' \
-H 'Authorization: Bearer {access_token}' \

Response:

 HTTP/1.1 200 OK

{ "id": "3d59f909-24cd-43bc-89cb-00a320617c0a", "status": "inSite", "browser": "Google Chrome 86.0.4240.75", "operatingSystem": "Windows 8.1", "screenResolution": "1680x1050", "language": "en-US", "ip": "192.168.2.128", "country": "China", "state": "Zhejiang", "city": "Hangzhou", "timeZone": "GMT +08:00", "visitTime": "2021-05-26T10:30:16.036Z", "firstVisitTime": "2021-05-26T10:31:29.597Z", "visits": 1, "chats": 0, "pageViews": 1, "currentBrowsing": "https://dash11.comm100.io/frontEnd/assets/livechat/previewpage/?campaignId=22f0b296-69e9-4b81-abe4-4bb9ed5ec9ef&siteId=10000&q=1622025088751", "referrerUrl": "https://dash11.comm100.io/frontEnd/assets/livechat/previewpage/?campaignId=22f0b296-69e9-4b81-abe4-4bb9ed5ec9ef&siteId=10000", "name": "192.168.2.128", "email": "123@comm100.com", "phone": "1234567890123", "company": "comm", "productService": "LA", "departmentId": "00000000-0000-0000-0000-000000000000", "searchEngine": "Google", "searchKeywords": "com", "landingPage": "https://dash11.comm100.io/frontEnd/assets/livechat/previewpage/?campaignId=22f0b296-69e9-4b81-abe4-4bb9ed5ec9ef&siteId=10000&q=1622025088751", "customFields": [], "customVariableResults": [ { "name": "CARLZHOU222SHENTI", "value": "11123123123", "url": "" }, { "name": "fccc", "value": "520", "url": "" } ] }
Put a visitor's info

PUT livechat/visitors/{id}

Parameters:

Name Type In Required Description
name string body yes Name of the custom variable.
value string body no Value of the custom variable.
url string body no URL of the custom variable.
Response:

Name Type Description
visits int Visit count of the visitor.
departmentId guid Department id of the visit.
productService string Product service of the visitor.
pageViews int Page view count of the visitor.
company string Company of the visitor.
customFields FieldAndValue[] Field and value array.
name Description
name Name of the field.
value Value of the field.
url Url of the field.
firstVisitTime datetime First visit time of the visitor.
email string Email of the visitor.
state string State of the visitor.
id guid Id of the visitor.
operatingSystem string Operating system of the visitor used.
visitTime datetime Visit time of the visitor.
landingPage string Landing page of the visit.
customVariableResults FieldAndValue[] Field and value array.
name Description
name Name of the custom variable.
value Value of the custom variable.
url Url of the custom variable.
name string Name of the visitor.
city string City of the visitor.
flashVersion string Flash version of the visitor used.
currentBrowsing string Current browsing of the visitor.
timeZone string Timezone of the visitor.
searchKeywords string Search keywords of the visit.
phone string Phone of the visitor.
searchEngine string Search engine of the visit.
chats int Chat count of the visitor.
browser string Browser of the visitor used.
language string Language of the visitor used.
referrerUrl string Referrer Url of the visitor.
ip string IP of the visitor.
country string Country of the visitor.
screenResolution string Screen resolution of the visitor used.
status string Allowed values are "waitingForChat", "voiceChatting","chatting","preChat","manuallyInvited","autoInvited","offlineMessage","refusedByOperator","refusedByVisitor","chatEnded","inSite","outOfSite","transferring","manuallyInvitedByWindow","systemProcessing".
Example

Sample Request:

curl https://api15.comm100.io/v4/livechat/visitors/3d59f909-24cd-43bc-89cb-00a320617c0a \
-X 'PUT' \
-H 'Authorization: Bearer {access_token}' \
-H 'Content-Type: application/json' \
-D '[ { "name": "visitor", "value": "Leo", "url": "" }, { "name": "company", "value": "Comm100", "url": "" } ] '

Response:

 HTTP/1.1 200 OK

{ "id": "3d59f909-24cd-43bc-89cb-00a320617c0a", "status": "inSite", "browser": "Google Chrome 86.0.4240.75", "operatingSystem": "Windows 8.1", "screenResolution": "1680x1050", "language": "en-US", "ip": "192.168.2.128", "country": "China", "state": "Zhejiang", "city": "Hangzhou", "timeZone": "GMT +08:00", "visitTime": "2021-05-26T10:30:16.036Z", "firstVisitTime": "2021-05-26T10:31:29.597Z", "visits": 1, "chats": 0, "pageViews": 1, "currentBrowsing": "https://dash11.comm100.io/frontEnd/assets/livechat/previewpage/?campaignId=22f0b296-69e9-4b81-abe4-4bb9ed5ec9ef&siteId=10000&q=1622025088751", "referrerUrl": "https://dash11.comm100.io/frontEnd/assets/livechat/previewpage/?campaignId=22f0b296-69e9-4b81-abe4-4bb9ed5ec9ef&siteId=10000", "name": "192.168.2.128", "email": "123@comm100.com", "phone": "1234567890123", "company": "comm", "productService": "LA", "departmentId": "00000000-0000-0000-0000-000000000000", "searchEngine": "Google", "searchKeywords": "com", "landingPage": "https://dash11.comm100.io/frontEnd/assets/livechat/previewpage/?campaignId=22f0b296-69e9-4b81-abe4-4bb9ed5ec9ef&siteId=10000&q=1622025088751", "customFields": [], "customVariableResults": [ { "name": "CARLZHOU222SHENTI", "value": "11123123123", "url": "" }, { "name": "fccc", "value": "520", "url": "" } ] }