Cognigy

Cognigy.AI Docs

COGNIGY.AI is the Conversational AI Platform focused on the needs of large enterprises to develop, deploy and run Conversational AI’s on any conversational channel.

Given the arising need of voice interfaces as the most natural way of communicating with brands, Cognigy was founded in 2016 by Sascha Poggemann and Phil Heltewig. Our mission: to enable all devices and applications to intelligently communicate with their users via naturally spoken or written dialogue.

Get Started

Deploy a REST Endpoint

Description

With the implementation of a REST Enpoint you can easily connect your Application with COGNIGY.AI by using our REST interface.

This tutorial covers the necessary steps for creating and connecting a REST Endpoint. If you want to get information about assigning a Flow to the Endpoint and setting up the Data Management see Endpoints.

One Step Preparation Process

1 Create and Configure a REST Endpoint on COGNIGY.AI

1 Create and Configure a REST Endpoint

:link: On COGNIGY.AI

1.1 Create a REST Enpoint


First you have to create a Endpoint of type "REST" (see figure 1.1).

Figure 1.1: Creation of the REST Endpoint

1.2 Get the Endpoint URL


Move to the top of the Endpoint Configuration page and copy the Endpoint URL which is displayed above the General Settings (see figure 1.2).

Figure 1.2: REST Endpoint Configuration Page

Final Step: Connect your Application to the Endpoint

:link: On Application of your choice

Requirements
Endpoint URL

After creating a REST Endpoint you are able to send POST requests to the Endpoint URL gathered in step 1.2. The body of the requests should have the following format:

{
  "userId":"userId",
  "sessionId": "someUniqueId",
  "text":"message text",
  "data": {
    "key": "value"
  }
}

Parameters
userId - a user ID of the end user in form of a string
sessionId - a unique ID that is used to track the current conversation in form of a string
text - message text that should get processed by the assigned flow in form of a string
data - message data that should get processed by the assigned flow in form of an object

📘

Sending text and data

You can use the REST Endpoint to send either text or data to your Flow. You can choose to send both, but at least one is required. If invalid text and invalid data is specified, then the REST Endpoint throws an error.

👍

Session ID

The sessionId is a unique identifier that is used to keep the state of a conversation. This means that you should generate a new unique ID whenever a new conversation starts, and not on every message. For testing purposes, you can use whatever string value you like as the sessionId, and change it whenever you want a new conversation to start.

The response contains the output text, output data and the outputStack, which is an array of all Flow outputs. Since the Rest Endpoint will concatenate all Flow Outputs (e.g. all Say Nodes) into one text / data output, you can use the outputStack for debugging purposes.

{
    "text": "output2",
    "data": {
        "output": 2
    },
    "outputStack": [
        {
            "text": "output 1",
            "data": {
                "output": 1
            }
        },
        {
            "text": "output 2",
            "data": {
                "output": 2
            }
        }
    ]
}

That's it. You should be all set up to use the REST Endpoint you've created with a Flow of your choice.

Updated 6 months ago


Deploy a REST Endpoint


Suggested Edits are limited on API Reference Pages

You can only suggest edits to Markdown body content, but not to the API spec.