Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 10 Current »

In this tutorial we will explain how EDDI handles the context of a conversation and which data can be provided within the scope of a conversation.

In order to talk to EDDI within a context a POST request shall be sent to /bots/{environment}/{botId}/{conversationId},(same way as interacting in a normal conversation in EDDI) but this time we must provide more parameters :


HTTP MethodPOST
API Endpoint

/bots/{environment}/{botId}/{conversationId}

{environment}

(Path parameter):String

deployment environment (e.g: restricted,unrestricted,test)

{botId}

(Path parameter):String

id of the bot as a path parameter.

{conversationId}

(Path parameter):String

id of the conversation as a path param

inputData a json object sent in the request body consists of the usual input text(message to the bot) only this time we are going to provide context information through a key value data structure (Map<String, Context>); the Context value must have one of the following :  string,object or expressions.
returnDetailed(Optional)  default is false - will return all sub results of the entire conversation steps, otherwise only public ones such as input, action, output & quickreplies.
returnCurrentStepOnly(Optional) default is true - will return only the latest conversation step that has just been processed, otherwise returns all conversation steps since the beginning of this conversation.


Example of a json object of the input data : 

inputData json example
{
  "input": "",
  "context": {
    "onboardingOfUser": {
      "type": "string",
      "value": "true"
    },
    "userInfo": {
      "type": "object",
      "value": {
        "username": "Barbara"
      }
    }
  }
}

We can also use http://localhost:7070/chat to test the context parameters by providing Context Type,Context Name, Context Value. see image below while chatting.


  • No labels