Kindly Docs

Go to App
⌘K
▶️Introduction
🔹Getting started with webhooks
🔹Webhooks reference
🔹Message processing
🔹Pattern dialogues
🔹Context memory
🔹Languages
📄Guides and Examples
◽Checking webhook signatures (HMACs)
◽Example: Chat transcript webhook
◽Kindly Chat authentication
◽Inbox backup to S3 bucket
◽Inbox backup to GCS bucket
◽Add the Spinnaker script tag to your site
◽Set up event tracking with Google Tag Manager (GTM)
⚙️APIs
▪️Application API
▪️Chat API
▪️Chat Transcript API
▪️Handover API
▪️Nudge API
▪️Statistics API
▪️iOS SDK
▪️Android SDK
▪️Text Predict API
▪️Ticket webhooks (BETA)
📦Legacy
📝APIs Changelog
🛡️Security
©️License and Disclaimer
Docs powered by Archbee
APIs

Text Predict API

The Text Predict API enables you to integrate with Kindly's AI backend using long message inquiries such as emails.

Getting started

New application

To start using the Text Predict API with your bot, you first need to let us know about your application.

  1. From the dashboard of your Kindly bot, expand Connect in the navigation menu and click Application.
  2. Click New application.
  3. Enter a descriptive name for your application.
  4. Under "webhook", you need to add Kindly's custom Text Predict API webhook (contact your contact person in Kindly(or support@kindly.ai) to get the webhook).
  5. Click Create application.
  6. You will now see a new API Key, which will act as your bearer token when interacting with the Text Predict API.

Authorization

With the API key in hand, you're ready to start integrating Kindly into your application.

Every request should include the header Authorization: Bearer <API_KEY>

Test Your Connection (with cURL)

You can test you connection using this curl command. Make sure to use your actual API key:

Shell
curl \
  -X POST \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer AvGAQfbp5syBIu3Lp1Hev_LHUcpWQ_uKxYrdFSMwLr54EJ7ApzKL4SvQl6fuTetC" \
  -d '{
    "user_id": "1",
    "message": "Hello Kindly! I want to know whether your Text Predict API is working or not. Best regard, John Doe",
    "sender": "test",
    "language_code": "en"
  }' \
https://summly.production.kindly.ai/message


The request may take a few seconds depending on how complex your Kindly bot is set up. The response will include information of the Kindly prediction, and you should validate that you can see your bot_id within the response JSON.

Sending and receiving

Sending

POST a message to https://summly.production.kindly.ai/message.

The POST payload should be in the following format:

JSON
{
    "user_id": "<unique-user-id>",
    "message": "<long-message>",
    "language_code": "<language-code>",
    "sender": "<identification-of-you>"
}

  • user_id: is a unique identifying for a user / session in the bot.
  • message: is the long text.
  • language_code: is the two letter language code of your bot. This is the ISO 639-1 format of your bots language. For examples:
    • English: en
    • Spanish: es
    • French: fr
    • etc...
  • sender: This a text that you decide that should clearly identify who you are. This is include your company and your use-case.

Receiving

The POST payload from Kindly has the following format:

JSON
{
    "exchange_id": "The id of the predicted dialogue",
    "exchange_type": "Greeting, dialogue or fallback",
    "user_id": "Unique user id",
    "reply_to_id": "The unique id of the session",
    "message": "Hello world!",
    "buttons": [
        {
            "id": "The button id",
            "type": "Type of button (possible values are 'quick_reply', 'link', 'email', 'phone')",
            "label": "Label of button",
            "value": "Message value when button is activated",
            "exchange_id": "Exchange identifier",
            "new_context": {
                "key": "value",
                "key2": 2,
                "key3": null
            }
        }
    ],
    "image_carousel": [
        {
            "altText": "This is the image alt text",
            "linkUrl": "https://example.com",
            "imageUrl": "https://example.com/image.jpg",
            "description": ""
        }
    ]
}




Updated 27 Oct 2023
Did this page help you?
PREVIOUS
Android SDK
NEXT
Ticket webhooks (BETA)
Docs powered by Archbee
TABLE OF CONTENTS
Getting started
New application
Authorization
Test Your Connection (with cURL)
Sending and receiving
Sending
Receiving
Docs powered by Archbee