Skip to main content

Quickstart

In this Quickstart we are setting up our first source, listen to conversations, and consume directly from Kafka

We are going to use Airy's Live Chat Plugin as our first source. We then use the plugin to send messages, and check them out in the UI, your terminal and directly in Apache Kafka.

Airy's Live Chat Plugin can be connected both through API request and the UI. This document covers both options.

Did you already install the Airy CLI?

To get going with the Quickstart, you must install Airy first. Once the CLI is up and running you are good to go.

Step 1: Set up your first source#

curl -H "Content-Type: application/json" -d \
"{
\"name\": \"chat plugin source\"
}" http://airy.core/channels.chatplugin.connect
channels_connect

The ID from the response is the channel_id. It is required for the next steps, so note it down.

Alternatively, you can connect an Airy's Live Chat Plugin channel via the UI.

On your instance's Airy Core UI, click on the 'Channels' icon on the left sidebar menu. Then, click on the button displaying a cross icon next to the Airy Live Chat channel.

chat plugin channels UI

Next, click on the blue button "Connect Airy Live Chat".

chat plugin channels UI

Enter a display name and optionally an image URL in the respective fields. The display name will be used as the conversation's name while the image URL will be used as its icon in the Inbox UI. A fallback image will be used if you do not enter a valid image URL. Click on the Save button.

chat plugin channels UI

An Airy's Live Chat Plugin channel will appear as connected in the Channels UI. Next, click on the button showing the connected channels.

chat plugin channels UI

This will bring you to a page where you can edit or disconnect each channel. Click on 'Edit'.

chat plugin channels UIchat plugin channels UI

Click on the 'Install app' tab. Here you will find the channel_id, which is located in the sample code (underlined in the screenshot below). It is required for the next steps, so note it down.

Step 2: Send messages via the Chat Plugin#

Pass the channel_id as a query parameter when opening the demo page in your browser. This authenticates the chat plugin and enables you to send messages immediately:

http://airy.core/chatplugin/ui/example?channel_id=<channel_id>

You can now type a message in the text box and send it πŸŽ‰

chatplugin working

Step 3: Use the HTTP API to list conversations#

To see how messages are flowing through the system, list conversations for the channel you have just created. it should return the message you have just sent.

conversations.list
curl -XPOST http://airy.core/conversations.list | jq .

The Inbox UI lists all your conversations, across all sources.

The screenshot below shows a conversation list in the Inbox UI. In this example, all the conversations have been created by connecting an Airy Live Chat channel to an Airy Core instance.

Each time you connect a new channel, a new conversation is created and added in the Inbox UI. You can then use it to respond to messages.

conversations list UI

Step 4: Consume directly from Apache Kafka#

You can also consume the messages directly from the Kafka application.communication.messages topic:

kubectl exec -it kafka-0 -- /bin/bash
kafka-console-consumer.sh \
--bootstrap-server kafka:9092 \
--topic application.communication.messages \
--from-beginning
Kafka Topic
Last updated on