Chatlio Server API

The Chatlio Server API allows you to interact with the Chatlio servers directly. If you have a need for a server API that is not listed below, please let us know!

The server API endpoints are based on REST. They accept form-encoded request bodies, return JSON-encoded responses, and use standard HTTP authentication, request methods and response codes. All endpoint URLs have the following format:

https://api.chatlio.com/v1/api/[endpoint-/specific/part]

Authentication

Calls to the Server API endpoints are authenticated using your Chatlio API key. Here is where you can find it:

  1. Open the Chatlio dashboard.
  2. Select the widget on which you want to use the Server API.
  3. On the Behavior tab, find the “API Key” field in the “Webhooks and post-chat actions” section (click the eye icon to uncover and copy).

API Key

Your API key should be treated as a password, so be sure to keep it secure. Do not share your API key in publicly accessible resources such as code repos and client-side code. If you believe your API key has been compromized, revoke it by generating a new one with the Regenerate API Key button right below the API Key field.

Your API key is scoped to your Chatlio account. To authenticate a server API call, provide your API key as the basic auth username value.

Example:

curl -u YOUR_API_KEY: https://api.chatlio.com/v1/api/chat_endpoints/all/conversation_summary?visitor_data=true

You can also authenticate via bearer auth by including an Authorization header in the call:

curl -H "Authorization: Bearer YOUR_API_KEY" https://api.chatlio.com/v1/api/chat_endpoints/all/conversation_summary

conversation_summary

Method: GET

URLs:

https://api.chatlio.com/v1/api/chat_endpoints/all/conversation_summary
https://api.chatlio.com/v1/api/chat_endpoints/[widget-id]/conversation_summary

Retrieves info about currently ongoing conversations for the widgets (also known as chat endpoints) under your Chatlio account.

To get the summary for a specific chat endpoint, provide the widget ID instead of all in the URL. Here is how to find your widget’s ID:

  1. Open the Chatlio dashboard.
  2. Select the widget that you want to find its ID.
  3. On the Widget Install tab, locate the <chatlio-widget> element embed code and find the value for the widgetid attribute.

If you want the response to include visitor metadata, pass the following parameter to the API call:

visitor_data=true

Example request:

curl -u YOUR_API_KEY: -G -d visitor_data=true 'https://api.chatlio.com/v1/api/chat_endpoints/all/conversation_summary

Example response:

[
  {
    "data_widget_id": "aac51067-2851-452c-9027-74c6521a5122",
    "slack_channel": "C02ZA71UP8Z",
    "slack_channel_url": "https://acme.slack.com/archives/C02ZA71UP8Z",
    "slack_channel_name": "acme-support",
    "unanswered_conversations": null,
    "inprogress_conversations": [
      {
        "slack_channel_name": "z-frank-doe-3183",
        "slack_channel_id": "C1539ZA5728",
        "slack_channel_url": "https://acme.slack.com/archives/C1539ZA5728",
        "first_message": "Hello there. I have a question about Acme Power W153",
        "visitor": {
          "ip_address": "192.168.1.24",
          "current_page_url": "https://acme.com/store/widgets/power-w153",
          "browser_info": "Firefox 98.0 Windows 10",
          "identify_user_id": "737",
          "location": "Amsterdam, Netherlands",
          "location_url": "https://www.google.com/maps?q=123,123",
          "local_time": "03:57am (CEST)",
          "identify_data": {
            "account": "4245122",
            "email": "[email protected]",
          }
        }
      }
    ]
  }
]
:(
Your browser is out-of-date!

This website is built using latest technogies. Unfortunately your browser doesn't support those. Please update your browser to view this website correctly. Thank you.Update my browser now