Interact - legacy (non-stream)
curl --request POST \
--url https://general-runtime.voiceflow.com/state/user/{userID}/interact \
--header 'Content-Type: application/json' \
--header 'authorization: <api-key>' \
--data '
{
"state": {
"variables": {}
},
"request": "<unknown>",
"action": "<unknown>",
"config": "<unknown>"
}
'import requests
url = "https://general-runtime.voiceflow.com/state/user/{userID}/interact"
payload = {
"state": { "variables": {} },
"request": "<unknown>",
"action": "<unknown>",
"config": "<unknown>"
}
headers = {
"authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
state: {variables: {}},
request: '<unknown>',
action: '<unknown>',
config: '<unknown>'
})
};
fetch('https://general-runtime.voiceflow.com/state/user/{userID}/interact', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://general-runtime.voiceflow.com/state/user/{userID}/interact",
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([
'state' => [
'variables' => [
]
],
'request' => '<unknown>',
'action' => '<unknown>',
'config' => '<unknown>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"authorization: <api-key>"
],
]);
$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 := "https://general-runtime.voiceflow.com/state/user/{userID}/interact"
payload := strings.NewReader("{\n \"state\": {\n \"variables\": {}\n },\n \"request\": \"<unknown>\",\n \"action\": \"<unknown>\",\n \"config\": \"<unknown>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("authorization", "<api-key>")
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("https://general-runtime.voiceflow.com/state/user/{userID}/interact")
.header("authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"state\": {\n \"variables\": {}\n },\n \"request\": \"<unknown>\",\n \"action\": \"<unknown>\",\n \"config\": \"<unknown>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://general-runtime.voiceflow.com/state/user/{userID}/interact")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"state\": {\n \"variables\": {}\n },\n \"request\": \"<unknown>\",\n \"action\": \"<unknown>\",\n \"config\": \"<unknown>\"\n}"
response = http.request(request)
puts response.read_bodyInteract - legacy (non-stream)
deprecated
This endpoint is deprecated. Use the Interact (non-stream) endpoint instead. This legacy endpoint will continue to work for now, and we’ll communicate a timeline for removal when one is available. We recommend migrating as soon as possible.
POST
/
state
/
user
/
{userID}
/
interact
Interact - legacy (non-stream)
curl --request POST \
--url https://general-runtime.voiceflow.com/state/user/{userID}/interact \
--header 'Content-Type: application/json' \
--header 'authorization: <api-key>' \
--data '
{
"state": {
"variables": {}
},
"request": "<unknown>",
"action": "<unknown>",
"config": "<unknown>"
}
'import requests
url = "https://general-runtime.voiceflow.com/state/user/{userID}/interact"
payload = {
"state": { "variables": {} },
"request": "<unknown>",
"action": "<unknown>",
"config": "<unknown>"
}
headers = {
"authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
state: {variables: {}},
request: '<unknown>',
action: '<unknown>',
config: '<unknown>'
})
};
fetch('https://general-runtime.voiceflow.com/state/user/{userID}/interact', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://general-runtime.voiceflow.com/state/user/{userID}/interact",
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([
'state' => [
'variables' => [
]
],
'request' => '<unknown>',
'action' => '<unknown>',
'config' => '<unknown>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"authorization: <api-key>"
],
]);
$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 := "https://general-runtime.voiceflow.com/state/user/{userID}/interact"
payload := strings.NewReader("{\n \"state\": {\n \"variables\": {}\n },\n \"request\": \"<unknown>\",\n \"action\": \"<unknown>\",\n \"config\": \"<unknown>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("authorization", "<api-key>")
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("https://general-runtime.voiceflow.com/state/user/{userID}/interact")
.header("authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"state\": {\n \"variables\": {}\n },\n \"request\": \"<unknown>\",\n \"action\": \"<unknown>\",\n \"config\": \"<unknown>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://general-runtime.voiceflow.com/state/user/{userID}/interact")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"state\": {\n \"variables\": {}\n },\n \"request\": \"<unknown>\",\n \"action\": \"<unknown>\",\n \"config\": \"<unknown>\"\n}"
response = http.request(request)
puts response.read_bodyAuthorizations
Voiceflow API key
Path Parameters
An ID which uniquely identifies the user having the conversation.
Maximum string length:
128Body
application/json
The user's response, e.g, user requests starting a conversation or advances the conversation by providing some textual response.
Optional settings to configure the response.
Response
200 - undefined
Was this page helpful?
⌘I