Passing context information

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

(Request body):JSON

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) (Query parameter):boolean
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)(Query parameter):boolean 
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.


Here is 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"
      }
    }
  }
}

Additional information:

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.