API Reference
Core request to execute a custom action
Rasa Core sends a request to the action server to execute a certain custom action. As a response to the action call from Core, you can modify the tracker, e.g. by setting slots and send responses back to the user.
POST
/
Core request to execute a custom action
curl --request POST \
--url http://localhost:5055/webhook/ \
--header 'Content-Type: application/json' \
--data '
{
"next_action": "<string>",
"sender_id": "<string>",
"tracker": {
"sender_id": "default",
"user_id": "usr_a1b2c3d4e5f6",
"current_session_id": "4b3c1e2a-91f0-4d8e-b123-abc123def456",
"slots": [
{
"slot_name": "slot_value"
}
],
"latest_event_time": 1537645578.314389,
"followup_action": "<string>",
"paused": false,
"stack": [
{
"frame_id": "8UJPHH5C",
"flow_id": "transfer_money",
"step_id": "START",
"frame_type": "regular",
"type": "flow"
}
],
"events": [
{
"event": "user",
"timestamp": 1774447464.622012,
"metadata": {
"session_id": "eed351b9-a996-4bb8-83ea-1d18e7cd4905",
"model_id": "80687713793f4d07957e8e51f73df866",
"assistant_id": "my-assistant"
},
"text": "<string>",
"input_channel": "<string>",
"message_id": "<string>",
"anonymized_at": "<string>"
}
],
"latest_input_channel": "rest",
"latest_action_name": "action_listen",
"latest_action": {
"action_name": "<string>",
"action_text": "<string>"
},
"active_loop": {
"name": "restaurant_form"
}
},
"domain": {
"config": {
"store_entities_as_slots": false
},
"intents": [
{}
],
"entities": [
"person",
"location"
],
"slots": {},
"responses": {},
"actions": [
"action_greet",
"action_goodbye",
"action_listen"
]
}
}
'import requests
url = "http://localhost:5055/webhook/"
payload = {
"next_action": "<string>",
"sender_id": "<string>",
"tracker": {
"sender_id": "default",
"user_id": "usr_a1b2c3d4e5f6",
"current_session_id": "4b3c1e2a-91f0-4d8e-b123-abc123def456",
"slots": [{ "slot_name": "slot_value" }],
"latest_event_time": 1537645578.314389,
"followup_action": "<string>",
"paused": False,
"stack": [
{
"frame_id": "8UJPHH5C",
"flow_id": "transfer_money",
"step_id": "START",
"frame_type": "regular",
"type": "flow"
}
],
"events": [
{
"event": "user",
"timestamp": 1774447464.622012,
"metadata": {
"session_id": "eed351b9-a996-4bb8-83ea-1d18e7cd4905",
"model_id": "80687713793f4d07957e8e51f73df866",
"assistant_id": "my-assistant"
},
"text": "<string>",
"input_channel": "<string>",
"message_id": "<string>",
"anonymized_at": "<string>"
}
],
"latest_input_channel": "rest",
"latest_action_name": "action_listen",
"latest_action": {
"action_name": "<string>",
"action_text": "<string>"
},
"active_loop": { "name": "restaurant_form" }
},
"domain": {
"config": { "store_entities_as_slots": False },
"intents": [{}],
"entities": ["person", "location"],
"slots": {},
"responses": {},
"actions": ["action_greet", "action_goodbye", "action_listen"]
}
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
next_action: '<string>',
sender_id: '<string>',
tracker: {
sender_id: 'default',
user_id: 'usr_a1b2c3d4e5f6',
current_session_id: '4b3c1e2a-91f0-4d8e-b123-abc123def456',
slots: [{slot_name: 'slot_value'}],
latest_event_time: 1537645578.314389,
followup_action: '<string>',
paused: false,
stack: [
{
frame_id: '8UJPHH5C',
flow_id: 'transfer_money',
step_id: 'START',
frame_type: 'regular',
type: 'flow'
}
],
events: [
{
event: 'user',
timestamp: 1774447464.622012,
metadata: {
session_id: 'eed351b9-a996-4bb8-83ea-1d18e7cd4905',
model_id: '80687713793f4d07957e8e51f73df866',
assistant_id: 'my-assistant'
},
text: '<string>',
input_channel: '<string>',
message_id: '<string>',
anonymized_at: '<string>'
}
],
latest_input_channel: 'rest',
latest_action_name: 'action_listen',
latest_action: {action_name: '<string>', action_text: '<string>'},
active_loop: {name: 'restaurant_form'}
},
domain: {
config: {store_entities_as_slots: false},
intents: [{}],
entities: ['person', 'location'],
slots: {},
responses: {},
actions: ['action_greet', 'action_goodbye', 'action_listen']
}
})
};
fetch('http://localhost:5055/webhook/', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_PORT => "5055",
CURLOPT_URL => "http://localhost:5055/webhook/",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'next_action' => '<string>',
'sender_id' => '<string>',
'tracker' => [
'sender_id' => 'default',
'user_id' => 'usr_a1b2c3d4e5f6',
'current_session_id' => '4b3c1e2a-91f0-4d8e-b123-abc123def456',
'slots' => [
[
'slot_name' => 'slot_value'
]
],
'latest_event_time' => 1537645578.314389,
'followup_action' => '<string>',
'paused' => false,
'stack' => [
[
'frame_id' => '8UJPHH5C',
'flow_id' => 'transfer_money',
'step_id' => 'START',
'frame_type' => 'regular',
'type' => 'flow'
]
],
'events' => [
[
'event' => 'user',
'timestamp' => 1774447464.622012,
'metadata' => [
'session_id' => 'eed351b9-a996-4bb8-83ea-1d18e7cd4905',
'model_id' => '80687713793f4d07957e8e51f73df866',
'assistant_id' => 'my-assistant'
],
'text' => '<string>',
'input_channel' => '<string>',
'message_id' => '<string>',
'anonymized_at' => '<string>'
]
],
'latest_input_channel' => 'rest',
'latest_action_name' => 'action_listen',
'latest_action' => [
'action_name' => '<string>',
'action_text' => '<string>'
],
'active_loop' => [
'name' => 'restaurant_form'
]
],
'domain' => [
'config' => [
'store_entities_as_slots' => false
],
'intents' => [
[
]
],
'entities' => [
'person',
'location'
],
'slots' => [
],
'responses' => [
],
'actions' => [
'action_greet',
'action_goodbye',
'action_listen'
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "http://localhost:5055/webhook/"
payload := strings.NewReader("{\n \"next_action\": \"<string>\",\n \"sender_id\": \"<string>\",\n \"tracker\": {\n \"sender_id\": \"default\",\n \"user_id\": \"usr_a1b2c3d4e5f6\",\n \"current_session_id\": \"4b3c1e2a-91f0-4d8e-b123-abc123def456\",\n \"slots\": [\n {\n \"slot_name\": \"slot_value\"\n }\n ],\n \"latest_event_time\": 1537645578.314389,\n \"followup_action\": \"<string>\",\n \"paused\": false,\n \"stack\": [\n {\n \"frame_id\": \"8UJPHH5C\",\n \"flow_id\": \"transfer_money\",\n \"step_id\": \"START\",\n \"frame_type\": \"regular\",\n \"type\": \"flow\"\n }\n ],\n \"events\": [\n {\n \"event\": \"user\",\n \"timestamp\": 1774447464.622012,\n \"metadata\": {\n \"session_id\": \"eed351b9-a996-4bb8-83ea-1d18e7cd4905\",\n \"model_id\": \"80687713793f4d07957e8e51f73df866\",\n \"assistant_id\": \"my-assistant\"\n },\n \"text\": \"<string>\",\n \"input_channel\": \"<string>\",\n \"message_id\": \"<string>\",\n \"anonymized_at\": \"<string>\"\n }\n ],\n \"latest_input_channel\": \"rest\",\n \"latest_action_name\": \"action_listen\",\n \"latest_action\": {\n \"action_name\": \"<string>\",\n \"action_text\": \"<string>\"\n },\n \"active_loop\": {\n \"name\": \"restaurant_form\"\n }\n },\n \"domain\": {\n \"config\": {\n \"store_entities_as_slots\": false\n },\n \"intents\": [\n {}\n ],\n \"entities\": [\n \"person\",\n \"location\"\n ],\n \"slots\": {},\n \"responses\": {},\n \"actions\": [\n \"action_greet\",\n \"action_goodbye\",\n \"action_listen\"\n ]\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("http://localhost:5055/webhook/")
.header("Content-Type", "application/json")
.body("{\n \"next_action\": \"<string>\",\n \"sender_id\": \"<string>\",\n \"tracker\": {\n \"sender_id\": \"default\",\n \"user_id\": \"usr_a1b2c3d4e5f6\",\n \"current_session_id\": \"4b3c1e2a-91f0-4d8e-b123-abc123def456\",\n \"slots\": [\n {\n \"slot_name\": \"slot_value\"\n }\n ],\n \"latest_event_time\": 1537645578.314389,\n \"followup_action\": \"<string>\",\n \"paused\": false,\n \"stack\": [\n {\n \"frame_id\": \"8UJPHH5C\",\n \"flow_id\": \"transfer_money\",\n \"step_id\": \"START\",\n \"frame_type\": \"regular\",\n \"type\": \"flow\"\n }\n ],\n \"events\": [\n {\n \"event\": \"user\",\n \"timestamp\": 1774447464.622012,\n \"metadata\": {\n \"session_id\": \"eed351b9-a996-4bb8-83ea-1d18e7cd4905\",\n \"model_id\": \"80687713793f4d07957e8e51f73df866\",\n \"assistant_id\": \"my-assistant\"\n },\n \"text\": \"<string>\",\n \"input_channel\": \"<string>\",\n \"message_id\": \"<string>\",\n \"anonymized_at\": \"<string>\"\n }\n ],\n \"latest_input_channel\": \"rest\",\n \"latest_action_name\": \"action_listen\",\n \"latest_action\": {\n \"action_name\": \"<string>\",\n \"action_text\": \"<string>\"\n },\n \"active_loop\": {\n \"name\": \"restaurant_form\"\n }\n },\n \"domain\": {\n \"config\": {\n \"store_entities_as_slots\": false\n },\n \"intents\": [\n {}\n ],\n \"entities\": [\n \"person\",\n \"location\"\n ],\n \"slots\": {},\n \"responses\": {},\n \"actions\": [\n \"action_greet\",\n \"action_goodbye\",\n \"action_listen\"\n ]\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("http://localhost:5055/webhook/")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"next_action\": \"<string>\",\n \"sender_id\": \"<string>\",\n \"tracker\": {\n \"sender_id\": \"default\",\n \"user_id\": \"usr_a1b2c3d4e5f6\",\n \"current_session_id\": \"4b3c1e2a-91f0-4d8e-b123-abc123def456\",\n \"slots\": [\n {\n \"slot_name\": \"slot_value\"\n }\n ],\n \"latest_event_time\": 1537645578.314389,\n \"followup_action\": \"<string>\",\n \"paused\": false,\n \"stack\": [\n {\n \"frame_id\": \"8UJPHH5C\",\n \"flow_id\": \"transfer_money\",\n \"step_id\": \"START\",\n \"frame_type\": \"regular\",\n \"type\": \"flow\"\n }\n ],\n \"events\": [\n {\n \"event\": \"user\",\n \"timestamp\": 1774447464.622012,\n \"metadata\": {\n \"session_id\": \"eed351b9-a996-4bb8-83ea-1d18e7cd4905\",\n \"model_id\": \"80687713793f4d07957e8e51f73df866\",\n \"assistant_id\": \"my-assistant\"\n },\n \"text\": \"<string>\",\n \"input_channel\": \"<string>\",\n \"message_id\": \"<string>\",\n \"anonymized_at\": \"<string>\"\n }\n ],\n \"latest_input_channel\": \"rest\",\n \"latest_action_name\": \"action_listen\",\n \"latest_action\": {\n \"action_name\": \"<string>\",\n \"action_text\": \"<string>\"\n },\n \"active_loop\": {\n \"name\": \"restaurant_form\"\n }\n },\n \"domain\": {\n \"config\": {\n \"store_entities_as_slots\": false\n },\n \"intents\": [\n {}\n ],\n \"entities\": [\n \"person\",\n \"location\"\n ],\n \"slots\": {},\n \"responses\": {},\n \"actions\": [\n \"action_greet\",\n \"action_goodbye\",\n \"action_listen\"\n ]\n }\n}"
response = http.request(request)
puts response.read_body{
"events": [
{
"event": "user",
"timestamp": 1774447464.622012,
"metadata": {
"session_id": "eed351b9-a996-4bb8-83ea-1d18e7cd4905",
"model_id": "80687713793f4d07957e8e51f73df866",
"assistant_id": "my-assistant"
},
"text": "<string>",
"input_channel": "<string>",
"message_id": "<string>",
"parse_data": {
"text": "Hello!",
"entities": [
{
"start": 123,
"end": 123,
"value": "<string>",
"entity": "<string>",
"confidence": 123
}
],
"intent": {
"confidence": 0.6323,
"name": "greet"
},
"intent_ranking": [
{
"confidence": 0.6323,
"name": "greet"
}
],
"message_id": "b2831e73-1407-4ba0-a861-0f30a42a2a5a",
"metadata": {},
"commands": [
{
"command": "start flow",
"flow": "transfer_money"
}
],
"flows_from_semantic_search": [
[
"transfer_money"
]
],
"flows_in_prompt": [
"transfer_money"
]
},
"anonymized_at": "<string>"
}
],
"responses": [
{
"text": "<string>"
}
]
}{
"action_name": "<string>",
"error": "<string>"
}Body
application/json
Describes the action to be called and provides information on the current state of the conversation.
Response
Action was executed succesfully.
Events returned by the action.
Event for incoming user message.
- Option 1
- Option 2
- Option 3
- Option 4
- Option 5
- Option 6
- Option 7
- Option 8
- Option 9
- Option 10
- Option 11
- Option 12
- Option 13
- Option 14
- Option 15
- Option 16
- Option 17
- Option 18
- Option 19
- Option 20
- Option 21
- Option 22
- Option 23
- Option 24
- Option 25
- Option 26
Show child attributes
Show child attributes
List of responses which should be sent to the user
Text which the bot should utter.
- Option 1
- Option 2
- Option 3
Show child attributes
Show child attributes
⌘I
Core request to execute a custom action
curl --request POST \
--url http://localhost:5055/webhook/ \
--header 'Content-Type: application/json' \
--data '
{
"next_action": "<string>",
"sender_id": "<string>",
"tracker": {
"sender_id": "default",
"user_id": "usr_a1b2c3d4e5f6",
"current_session_id": "4b3c1e2a-91f0-4d8e-b123-abc123def456",
"slots": [
{
"slot_name": "slot_value"
}
],
"latest_event_time": 1537645578.314389,
"followup_action": "<string>",
"paused": false,
"stack": [
{
"frame_id": "8UJPHH5C",
"flow_id": "transfer_money",
"step_id": "START",
"frame_type": "regular",
"type": "flow"
}
],
"events": [
{
"event": "user",
"timestamp": 1774447464.622012,
"metadata": {
"session_id": "eed351b9-a996-4bb8-83ea-1d18e7cd4905",
"model_id": "80687713793f4d07957e8e51f73df866",
"assistant_id": "my-assistant"
},
"text": "<string>",
"input_channel": "<string>",
"message_id": "<string>",
"anonymized_at": "<string>"
}
],
"latest_input_channel": "rest",
"latest_action_name": "action_listen",
"latest_action": {
"action_name": "<string>",
"action_text": "<string>"
},
"active_loop": {
"name": "restaurant_form"
}
},
"domain": {
"config": {
"store_entities_as_slots": false
},
"intents": [
{}
],
"entities": [
"person",
"location"
],
"slots": {},
"responses": {},
"actions": [
"action_greet",
"action_goodbye",
"action_listen"
]
}
}
'import requests
url = "http://localhost:5055/webhook/"
payload = {
"next_action": "<string>",
"sender_id": "<string>",
"tracker": {
"sender_id": "default",
"user_id": "usr_a1b2c3d4e5f6",
"current_session_id": "4b3c1e2a-91f0-4d8e-b123-abc123def456",
"slots": [{ "slot_name": "slot_value" }],
"latest_event_time": 1537645578.314389,
"followup_action": "<string>",
"paused": False,
"stack": [
{
"frame_id": "8UJPHH5C",
"flow_id": "transfer_money",
"step_id": "START",
"frame_type": "regular",
"type": "flow"
}
],
"events": [
{
"event": "user",
"timestamp": 1774447464.622012,
"metadata": {
"session_id": "eed351b9-a996-4bb8-83ea-1d18e7cd4905",
"model_id": "80687713793f4d07957e8e51f73df866",
"assistant_id": "my-assistant"
},
"text": "<string>",
"input_channel": "<string>",
"message_id": "<string>",
"anonymized_at": "<string>"
}
],
"latest_input_channel": "rest",
"latest_action_name": "action_listen",
"latest_action": {
"action_name": "<string>",
"action_text": "<string>"
},
"active_loop": { "name": "restaurant_form" }
},
"domain": {
"config": { "store_entities_as_slots": False },
"intents": [{}],
"entities": ["person", "location"],
"slots": {},
"responses": {},
"actions": ["action_greet", "action_goodbye", "action_listen"]
}
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
next_action: '<string>',
sender_id: '<string>',
tracker: {
sender_id: 'default',
user_id: 'usr_a1b2c3d4e5f6',
current_session_id: '4b3c1e2a-91f0-4d8e-b123-abc123def456',
slots: [{slot_name: 'slot_value'}],
latest_event_time: 1537645578.314389,
followup_action: '<string>',
paused: false,
stack: [
{
frame_id: '8UJPHH5C',
flow_id: 'transfer_money',
step_id: 'START',
frame_type: 'regular',
type: 'flow'
}
],
events: [
{
event: 'user',
timestamp: 1774447464.622012,
metadata: {
session_id: 'eed351b9-a996-4bb8-83ea-1d18e7cd4905',
model_id: '80687713793f4d07957e8e51f73df866',
assistant_id: 'my-assistant'
},
text: '<string>',
input_channel: '<string>',
message_id: '<string>',
anonymized_at: '<string>'
}
],
latest_input_channel: 'rest',
latest_action_name: 'action_listen',
latest_action: {action_name: '<string>', action_text: '<string>'},
active_loop: {name: 'restaurant_form'}
},
domain: {
config: {store_entities_as_slots: false},
intents: [{}],
entities: ['person', 'location'],
slots: {},
responses: {},
actions: ['action_greet', 'action_goodbye', 'action_listen']
}
})
};
fetch('http://localhost:5055/webhook/', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_PORT => "5055",
CURLOPT_URL => "http://localhost:5055/webhook/",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'next_action' => '<string>',
'sender_id' => '<string>',
'tracker' => [
'sender_id' => 'default',
'user_id' => 'usr_a1b2c3d4e5f6',
'current_session_id' => '4b3c1e2a-91f0-4d8e-b123-abc123def456',
'slots' => [
[
'slot_name' => 'slot_value'
]
],
'latest_event_time' => 1537645578.314389,
'followup_action' => '<string>',
'paused' => false,
'stack' => [
[
'frame_id' => '8UJPHH5C',
'flow_id' => 'transfer_money',
'step_id' => 'START',
'frame_type' => 'regular',
'type' => 'flow'
]
],
'events' => [
[
'event' => 'user',
'timestamp' => 1774447464.622012,
'metadata' => [
'session_id' => 'eed351b9-a996-4bb8-83ea-1d18e7cd4905',
'model_id' => '80687713793f4d07957e8e51f73df866',
'assistant_id' => 'my-assistant'
],
'text' => '<string>',
'input_channel' => '<string>',
'message_id' => '<string>',
'anonymized_at' => '<string>'
]
],
'latest_input_channel' => 'rest',
'latest_action_name' => 'action_listen',
'latest_action' => [
'action_name' => '<string>',
'action_text' => '<string>'
],
'active_loop' => [
'name' => 'restaurant_form'
]
],
'domain' => [
'config' => [
'store_entities_as_slots' => false
],
'intents' => [
[
]
],
'entities' => [
'person',
'location'
],
'slots' => [
],
'responses' => [
],
'actions' => [
'action_greet',
'action_goodbye',
'action_listen'
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "http://localhost:5055/webhook/"
payload := strings.NewReader("{\n \"next_action\": \"<string>\",\n \"sender_id\": \"<string>\",\n \"tracker\": {\n \"sender_id\": \"default\",\n \"user_id\": \"usr_a1b2c3d4e5f6\",\n \"current_session_id\": \"4b3c1e2a-91f0-4d8e-b123-abc123def456\",\n \"slots\": [\n {\n \"slot_name\": \"slot_value\"\n }\n ],\n \"latest_event_time\": 1537645578.314389,\n \"followup_action\": \"<string>\",\n \"paused\": false,\n \"stack\": [\n {\n \"frame_id\": \"8UJPHH5C\",\n \"flow_id\": \"transfer_money\",\n \"step_id\": \"START\",\n \"frame_type\": \"regular\",\n \"type\": \"flow\"\n }\n ],\n \"events\": [\n {\n \"event\": \"user\",\n \"timestamp\": 1774447464.622012,\n \"metadata\": {\n \"session_id\": \"eed351b9-a996-4bb8-83ea-1d18e7cd4905\",\n \"model_id\": \"80687713793f4d07957e8e51f73df866\",\n \"assistant_id\": \"my-assistant\"\n },\n \"text\": \"<string>\",\n \"input_channel\": \"<string>\",\n \"message_id\": \"<string>\",\n \"anonymized_at\": \"<string>\"\n }\n ],\n \"latest_input_channel\": \"rest\",\n \"latest_action_name\": \"action_listen\",\n \"latest_action\": {\n \"action_name\": \"<string>\",\n \"action_text\": \"<string>\"\n },\n \"active_loop\": {\n \"name\": \"restaurant_form\"\n }\n },\n \"domain\": {\n \"config\": {\n \"store_entities_as_slots\": false\n },\n \"intents\": [\n {}\n ],\n \"entities\": [\n \"person\",\n \"location\"\n ],\n \"slots\": {},\n \"responses\": {},\n \"actions\": [\n \"action_greet\",\n \"action_goodbye\",\n \"action_listen\"\n ]\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("http://localhost:5055/webhook/")
.header("Content-Type", "application/json")
.body("{\n \"next_action\": \"<string>\",\n \"sender_id\": \"<string>\",\n \"tracker\": {\n \"sender_id\": \"default\",\n \"user_id\": \"usr_a1b2c3d4e5f6\",\n \"current_session_id\": \"4b3c1e2a-91f0-4d8e-b123-abc123def456\",\n \"slots\": [\n {\n \"slot_name\": \"slot_value\"\n }\n ],\n \"latest_event_time\": 1537645578.314389,\n \"followup_action\": \"<string>\",\n \"paused\": false,\n \"stack\": [\n {\n \"frame_id\": \"8UJPHH5C\",\n \"flow_id\": \"transfer_money\",\n \"step_id\": \"START\",\n \"frame_type\": \"regular\",\n \"type\": \"flow\"\n }\n ],\n \"events\": [\n {\n \"event\": \"user\",\n \"timestamp\": 1774447464.622012,\n \"metadata\": {\n \"session_id\": \"eed351b9-a996-4bb8-83ea-1d18e7cd4905\",\n \"model_id\": \"80687713793f4d07957e8e51f73df866\",\n \"assistant_id\": \"my-assistant\"\n },\n \"text\": \"<string>\",\n \"input_channel\": \"<string>\",\n \"message_id\": \"<string>\",\n \"anonymized_at\": \"<string>\"\n }\n ],\n \"latest_input_channel\": \"rest\",\n \"latest_action_name\": \"action_listen\",\n \"latest_action\": {\n \"action_name\": \"<string>\",\n \"action_text\": \"<string>\"\n },\n \"active_loop\": {\n \"name\": \"restaurant_form\"\n }\n },\n \"domain\": {\n \"config\": {\n \"store_entities_as_slots\": false\n },\n \"intents\": [\n {}\n ],\n \"entities\": [\n \"person\",\n \"location\"\n ],\n \"slots\": {},\n \"responses\": {},\n \"actions\": [\n \"action_greet\",\n \"action_goodbye\",\n \"action_listen\"\n ]\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("http://localhost:5055/webhook/")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"next_action\": \"<string>\",\n \"sender_id\": \"<string>\",\n \"tracker\": {\n \"sender_id\": \"default\",\n \"user_id\": \"usr_a1b2c3d4e5f6\",\n \"current_session_id\": \"4b3c1e2a-91f0-4d8e-b123-abc123def456\",\n \"slots\": [\n {\n \"slot_name\": \"slot_value\"\n }\n ],\n \"latest_event_time\": 1537645578.314389,\n \"followup_action\": \"<string>\",\n \"paused\": false,\n \"stack\": [\n {\n \"frame_id\": \"8UJPHH5C\",\n \"flow_id\": \"transfer_money\",\n \"step_id\": \"START\",\n \"frame_type\": \"regular\",\n \"type\": \"flow\"\n }\n ],\n \"events\": [\n {\n \"event\": \"user\",\n \"timestamp\": 1774447464.622012,\n \"metadata\": {\n \"session_id\": \"eed351b9-a996-4bb8-83ea-1d18e7cd4905\",\n \"model_id\": \"80687713793f4d07957e8e51f73df866\",\n \"assistant_id\": \"my-assistant\"\n },\n \"text\": \"<string>\",\n \"input_channel\": \"<string>\",\n \"message_id\": \"<string>\",\n \"anonymized_at\": \"<string>\"\n }\n ],\n \"latest_input_channel\": \"rest\",\n \"latest_action_name\": \"action_listen\",\n \"latest_action\": {\n \"action_name\": \"<string>\",\n \"action_text\": \"<string>\"\n },\n \"active_loop\": {\n \"name\": \"restaurant_form\"\n }\n },\n \"domain\": {\n \"config\": {\n \"store_entities_as_slots\": false\n },\n \"intents\": [\n {}\n ],\n \"entities\": [\n \"person\",\n \"location\"\n ],\n \"slots\": {},\n \"responses\": {},\n \"actions\": [\n \"action_greet\",\n \"action_goodbye\",\n \"action_listen\"\n ]\n }\n}"
response = http.request(request)
puts response.read_body{
"events": [
{
"event": "user",
"timestamp": 1774447464.622012,
"metadata": {
"session_id": "eed351b9-a996-4bb8-83ea-1d18e7cd4905",
"model_id": "80687713793f4d07957e8e51f73df866",
"assistant_id": "my-assistant"
},
"text": "<string>",
"input_channel": "<string>",
"message_id": "<string>",
"parse_data": {
"text": "Hello!",
"entities": [
{
"start": 123,
"end": 123,
"value": "<string>",
"entity": "<string>",
"confidence": 123
}
],
"intent": {
"confidence": 0.6323,
"name": "greet"
},
"intent_ranking": [
{
"confidence": 0.6323,
"name": "greet"
}
],
"message_id": "b2831e73-1407-4ba0-a861-0f30a42a2a5a",
"metadata": {},
"commands": [
{
"command": "start flow",
"flow": "transfer_money"
}
],
"flows_from_semantic_search": [
[
"transfer_money"
]
],
"flows_in_prompt": [
"transfer_money"
]
},
"anonymized_at": "<string>"
}
],
"responses": [
{
"text": "<string>"
}
]
}{
"action_name": "<string>",
"error": "<string>"
}