Chat Server
  • 16 Jun 2022
  • 7 Minutes to read
  • Dark
    Light

Chat Server

  • Dark
    Light

Article summary

Chat Server

Get status for the list of agents

GET livechat/agents

  • Parameters:

No Parameters

  • Response:

An array of agents' staus

NameTypeDescription
ongoingChatsintThe ongoing chats number of the agent.
statusstringName of the status.
idguidId of the agent.
  • Example

Sample Request:

curl https://api11.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 status for an agent

GET livechat/agents/{id}

  • Parameters:

No Parameters

  • Response:

NameTypeDescription
idguidId of the agent.
statusstringName of the status.
ongoingChatsintThe ongoing chats number of the agent.
  • Example

Sample Request:

curl https://api11.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 status for an agent

PUT livechat/agents/{id}

  • Parameters:

NameTypeinRequiredDescription
statusstringbodyyesAllowed values are "online","away" and other custom away status if enabled.
  • Response:

NameTypeDescription
idguidId of the agent.
statusstringName of the status.
ongoingChatsintThe ongoing chats number of the agent.
  • Example

Sample Request:

curl https://api11.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 info for the list of visitors

GET livechat/visitors

  • Parameters:

No Parameters

  • Response:

An array of visitors' info

NameTypeDescription
languagestringLanguage of the visitor used.
phonestringPhone of the visitor.
namestringName of the visitor.
pageViewsintPage view count of the visitor.
flashVersionstringFlash version of the visitor used.
companystringCompany of the visitor.
timeZonestringTimezone of the visitor.
browserstringBrowser of the visitor used.
customFieldsFieldAndValue[]Field and value array.
nameDescription
nameName of the field.
valueValue of the field.
urlUrl of the field.
referrerUrlstringReferrer Url of the visitor.
emailstringEmail of the visitor.
visitsintVisit count of the visitor.
landingPagestringLanding page of the visit.
operatingSystemstringOperating system of the visitor used.
screenResolutionstringScreen resolution of the visitor used.
searchEnginestringSearch engine of the visit.
visitTimedatetimeVisit time of the visitor.
idguidId of the visitor.
firstVisitTimedatetimeFirst visit time of the visitor.
citystringCity of the visitor.
currentBrowsingstringCurrent browsing of the visitor.
departmentIdguidDepartment id of the visit.
searchKeywordsstringSearch keywords of the visit.
ipstringIP of the visitor.
chatsintChat count of the visitor.
statusstringAllowed values are "waitingForChat", "voiceChatting","chatting","preChat","manuallyInvited","autoInvited","offlineMessage","refusedByOperator","refusedByVisitor","chatEnded","inSite","outOfSite","transferring","manuallyInvitedByWindow","systemProcessing".
customVariableResultsFieldAndValue[]Field and value array.
nameDescription
nameName of the custom variable.
valueValue of the custom variable.
urlUrl of the custom variable.
productServicestringProduct service of the visitor.
countrystringCountry of the visitor.
statestringState of the visitor.
  • Example

Sample Request:

curl https://api11.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://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": ""
          }
      ]
  }
] 

Get info for a visitor

GET livechat/visitors/{id}

  • Parameters:

No Parameters

  • Response:

NameTypeDescription
browserstringBrowser of the visitor used.
chatsintChat count of the visitor.
landingPagestringLanding page of the visit.
screenResolutionstringScreen resolution of the visitor used.
searchEnginestringSearch engine of the visit.
statusstringAllowed values are "waitingForChat", "voiceChatting","chatting","preChat","manuallyInvited","autoInvited","offlineMessage","refusedByOperator","refusedByVisitor","chatEnded","inSite","outOfSite","transferring","manuallyInvitedByWindow","systemProcessing".
visitTimedatetimeVisit time of the visitor.
languagestringLanguage of the visitor used.
phonestringPhone of the visitor.
namestringName of the visitor.
searchKeywordsstringSearch keywords of the visit.
visitsintVisit count of the visitor.
referrerUrlstringReferrer Url of the visitor.
pageViewsintPage view count of the visitor.
flashVersionstringFlash version of the visitor used.
departmentIdguidDepartment id of the visit.
customFieldsFieldAndValue[]Field and value array.
nameDescription
nameName of the field.
valueValue of the field.
urlUrl of the field.
ipstringIP of the visitor.
operatingSystemstringOperating system of the visitor used.
citystringCity of the visitor.
statestringState of the visitor.
emailstringEmail of the visitor.
idguidId of the visitor.
countrystringCountry of the visitor.
productServicestringProduct service of the visitor.
firstVisitTimedatetimeFirst visit time of the visitor.
timeZonestringTimezone of the visitor.
currentBrowsingstringCurrent browsing of the visitor.
customVariableResultsFieldAndValue[]Field and value array.
nameDescription
nameName of the custom variable.
valueValue of the custom variable.
urlUrl of the custom variable.
companystringCompany of the visitor.
  • Example

Sample Request:

curl https://api11.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": ""
      }
  ]
} 

Update info for a visitor

PUT livechat/visitors/{id}

  • Parameters:

NameTypeinRequiredDescription
namestringbodyyesName of the custom variable.
valuestringbodynoValue of the custom variable.
urlstringbodynoURL of the custom variable.
  • Response:

NameTypeDescription
visitsintVisit count of the visitor.
departmentIdguidDepartment id of the visit.
productServicestringProduct service of the visitor.
pageViewsintPage view count of the visitor.
companystringCompany of the visitor.
customFieldsFieldAndValue[]Field and value array.
nameDescription
nameName of the field.
valueValue of the field.
urlUrl of the field.
firstVisitTimedatetimeFirst visit time of the visitor.
emailstringEmail of the visitor.
statestringState of the visitor.
idguidId of the visitor.
operatingSystemstringOperating system of the visitor used.
visitTimedatetimeVisit time of the visitor.
landingPagestringLanding page of the visit.
customVariableResultsFieldAndValue[]Field and value array.
nameDescription
nameName of the custom variable.
valueValue of the custom variable.
urlUrl of the custom variable.
namestringName of the visitor.
citystringCity of the visitor.
flashVersionstringFlash version of the visitor used.
currentBrowsingstringCurrent browsing of the visitor.
timeZonestringTimezone of the visitor.
searchKeywordsstringSearch keywords of the visit.
phonestringPhone of the visitor.
searchEnginestringSearch engine of the visit.
chatsintChat count of the visitor.
browserstringBrowser of the visitor used.
languagestringLanguage of the visitor used.
referrerUrlstringReferrer Url of the visitor.
ipstringIP of the visitor.
countrystringCountry of the visitor.
screenResolutionstringScreen resolution of the visitor used.
statusstringAllowed values are "waitingForChat", "voiceChatting","chatting","preChat","manuallyInvited","autoInvited","offlineMessage","refusedByOperator","refusedByVisitor","chatEnded","inSite","outOfSite","transferring","manuallyInvitedByWindow","systemProcessing".
  • Example

Sample Request:

curl https://api11.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": ""
      }
  ]
} 

Was this article helpful?