Search…
Managed Bots

Managed Bots

This feature will allow you to take advantage of EDDI's automatic management of bots, it is possible to avoid creating conversations and managing them manually, but let them be managed by EDDI.
This will act as a shortcut to start directly a conversation with a bot that covers a specific intent.
But first you will have to set up a BotTrigger.

BotTrigger

The request model

1
{
2
"intent": "string",
3
"botDeployments": [
4
{
5
"environment": "restricted",
6
"botId": "string",
7
"initialContext": {
8
"additionalProp1": {
9
"type": "string",
10
"value": {}
11
},
12
"additionalProp2": {
13
"type": "string",
14
"value": {}
15
},
16
"additionalProp3": {
17
"type": "string",
18
"value": {}
19
}
20
}
21
}
22
]
23
}
Copied!

Description of the request model

Element
Description
intent
(String) keyword or phrase (camel case or with '-') that will be used in managed bots to trigger the bots defined in this model
botDeployments
(Array:<BotDeployment>) array of BotDeployment. If multiple botDeployments are defined, one will be picked randomly.
environment
(String) the environment that you would like
botId
(String) the id of the bot that you want to create the botTrigger for it.
initialContext
(Array <Object> ) As context can be handed over on each request to the bot, initialContext allows the definition of context the bot should get at the very first conversation step when a conversation with the bot is started (only way to get context to the bot in the first conversation step)

BotTrigger API endpoints

HTTP Method
API Endpoint
Request Body
Response
DELETE
/bottriggerstore/bottriggers/{intent}
N/A
N/A
GET
/bottriggerstore/bottriggers/{intent}
N/A
Bot Triggers-model
PUT
/bottriggerstore/bottriggers/{intent}
Bot Triggers-model
N/A
POST
/bottriggerstore/bottriggers
Bot Triggers-model
N/A

Triggering a ManagedBot

To trigger a managed bot you will have to call the following API endpoints.

API Methods

HTTP Method
API Endpoint
Request Body
Response
GET
/managedbots​/{intent}​/{userId}
N/A
Conversation model
POST
/managedbots​/{intent}​/{userId}
Input model
N/A
POST
/managedbots​/{intent}​/{userId}​/endConversation
Input model
N/A

Description API endpoint required path parameters

Element
Description
{intent}​
(String) the label/keyword used originally to point to this BotTrigger
{userId}​
(String) used to specify the user who triggered the conversation

Example :

1/Create a BotTrigger

Request URL:
POST http://localhost:7070//bottriggerstore/bottriggers
Request Body
1
{
2
"intent": "weather_trigger",
3
"botDeployments": [
4
{
5
"environment": "unrestricted",
6
"botId": "5bf5418c46e0fb000b7636d0",
7
"initialContext": {}
8
}
9
]
10
}
Copied!
Response Body
no content
Response Code
200
Response Headers
1
access-control-allow-headers: authorization, Content-Type
2
access-control-allow-methods: GET, PUT, POST, DELETE, PATCH, OPTIONS
3
access-control-allow-origin: *
4
access-control-expose-headers: location
5
connection: Keep-Alive
6
content-length: 0
7
date: Mon, 18 Mar 2019 00:31:07 GMT
8
keep-alive: timeout=5, max=100
9
server: Apache/2.4.29 (Ubuntu)
Copied!

2/Trigger the ManagedBot

Request URL:
POST http://localhost:7070/managedbots/weather_trigger/myUserId
Request Body
1
{
2
"input": "Hello managed bot!",
3
"context": {}
4
}
Copied!
Response Body
1
{
2
"botId": "5bf5418c46e0fb000b7636d0",
3
"botVersion": 10,
4
"userId": "myUserId",
5
"environment": "unrestricted",
6
"conversationState": "READY",
7
"redoCacheSize": 0,
8
"conversationOutputs": [
9
{
10
"input": "Hello managed bot!",
11
"expressions": "unknown(Hello), unknown(managed), unknown(bot!)",
12
"intents": [
13
"unknown",
14
"unknown",
15
"unknown"
16
]
17
}
18
],
19
"conversationProperties": {},
20
"conversationSteps": [
21
{
22
"conversationStep": [
23
{
24
"key": "input:initial",
25
"value": "Hello managed bot!"
26
}
27
],
28
"timestamp": 1552869578596
29
}
30
]
31
}
Copied!
Response Code
200
Response Headers
1
access-control-allow-headers: authorization, Content-Type
2
access-control-allow-methods: GET, PUT, POST, DELETE, PATCH, OPTIONS
3
access-control-allow-origin: *
4
access-control-expose-headers: location
5
connection: Keep-Alive
6
content-length: 0
7
date: Mon, 18 Mar 2019 00:31:07 GMT
8
keep-alive: timeout=5, max=100
9
server: Apache/2.4.29 (Ubuntu)
Copied!
Last modified 1yr ago