{
Nice Chat API
}
Back to Homepage
{
Nice Chat API
}

Nice Chat Callbacks (webhooks)

The Webhooks are the actions which pushed when some event was triggered on Nice Chat.

The Callbacks are under active development right now and will be described at this page later.

Callback types

Tech

Tech-notifications pushed as JSON-dump of triggered object. There are two delivery methods for technical notifications: by POST-query, by email.

Humanize

Human-like notifications pushed as plain text by email or Slack.

Events

New Visitor (cold-lead)

"New Visitor" triggered when NiceChat detects a new unique user on your site. This can be used if you want to track site traffic, or store data about cold clients.

{
   "data": {
      "id": 725,
      "product_view_count": 0,
      "first_ts": "2017-06-13T13:53:55+00:00",
      "visit_count": 0,
      "last_activity_ts": "2017-06-13T13:53:55+00:00",
      "event": "new_visitor",
      "purchase_count": 0,
      "unaccepted_chat_count": 0,
      "client_name": "Guest",
      "chat_count": 0,
      "void_chat_count": 0
   },
   "event": "new_visitor"
}

New Chat (warm-lead)

"New Chat" triggered when anybody start new chat.

{
   "data": {
      "id": 109,
      "client_id": 725,
      "sys_ip": "193.151.12.99",
      "geoCountry": "Ukraine",
      "geoCity": "Kryvyy Rih",
      "geo_lon": -90.0,
      "geo_lat": -180.0,
      "sys_time": -180,
      "sys_lang": "uk",
      "sys_lang_full": "uk",
      "sys_browser": "Chrome 59.0.3071.86",
      "sys_os": "MacOS Macintosh X 10.12.5",
      "page_ref": "(direct)",
      "page_utm": {},
      "ts_open": "2017-06-13T18:21:29+00:00",
      "client_name": "Guest",
      "ts_close": null
   },
   "event": "new_chat"
}

First message (hot-lead)

"Client first message" triggered when a visitor puts first message on chat.

"event" property is "first_message". "data" section the same as in "New Chat".

Unanswered chat (angry-lead)

"Unanswered chat" triggered when a visitor starts chat (manually or by follow autoopen link), but no one answered him.

"event" property is "unanswered". "data" section the same as in "New Chat".

Purchase

"New Order" triggered when a visitor completes his purchase (fill Order-form at now), or make purchase at site.

{
   "data": {
      "id": 23,
      "chat_id": 170,
      "website": 5,
      "billing_address": {},
      "qty": 1,
      "order_date": "2017-06-13T13:54:45+00:00",
      "client": 725,
      "products": [
         {
            "title": "\u041f\u0440\u0438\u043c\u0435\u0442 \u0442\u043e\u0432\u0430\u0440\u0430",
            "url": "https://example.com/example-t.html",
            "price": 1000.00,
            "currency": "UAH",
            "original_id": "1315",
            "image_url": "https://cdn.nice.chat/media/2017-5/26/071e734403ffafe3fdb47c7b91365af5a4ce14ae.jpg"
         }
      ],
      "shipping_address": {},
      "order_num": "n/a",
      "agents": [
         {
            "first_name": "Admin",
            "last_name": adminus",
            "email": "admin@example.com"
         }
      ],
      "product_detail": {
         "sysIp": "193.151.12.99",
         "geoCountry": "Ukraine",
         "sysBrowser": "Chrome 59.0.3071.86",
         "sysLangFull": "uk",
         "sysOs": "MacOS Macintosh X 10.12.5",
         "sysTime": -180,
         "geoCity": "Kryvyy Rih"
      }
   },
   "event": "new_order" }

Filled Form

"Form filled" triggered when visitor fill any form.

{
   "data": {
      "id": 10,
      "form_id": 18,
      "website": 5,
      "created": "2017-06-13T18:25:53+00:00",
      "label": "There are no operators available now",
      "client": 725,
      "chat_id": 172,
      "result": [
         {
            "type": "title",
            "label": "There are no operators available now"
         },
         {
            "type": "flat",
            "label": "default"
            "data": [
               {
                  "type": "text",
                  "value": "My name is Test",
                  "label": "Name"
               },
               {
                  "type": "email",
                  "value": "test@example.com",
                  "label": "Email"
               }
            ],
         }
      ]
   },
   "event": "push_form"
}