Get conversation state
curl --request GET \
--url https://general-runtime.voiceflow.com/state/user/{userID} \
--header 'authorization: <api-key>' \
--header 'projectID: <projectid>'import requests
url = "https://general-runtime.voiceflow.com/state/user/{userID}"
headers = {
"projectID": "<projectid>",
"authorization": "<api-key>"
}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {projectID: '<projectid>', authorization: '<api-key>'}};
fetch('https://general-runtime.voiceflow.com/state/user/{userID}', 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}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"authorization: <api-key>",
"projectID: <projectid>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://general-runtime.voiceflow.com/state/user/{userID}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("projectID", "<projectid>")
req.Header.Add("authorization", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://general-runtime.voiceflow.com/state/user/{userID}")
.header("projectID", "<projectid>")
.header("authorization", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://general-runtime.voiceflow.com/state/user/{userID}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["projectID"] = '<projectid>'
request["authorization"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"stack": [
{
"diagramID": "<string>",
"storage": {},
"variables": {},
"nodeID": "<string>",
"name": null,
"commands": [
{
"type": "<string>"
}
],
"dynamicCommands": {}
}
],
"variables": {},
"storage": {},
"turn": {}
}Get conversation state
Fetch the current state of the user’s conversation.
GET
/
state
/
user
/
{userID}
Get conversation state
curl --request GET \
--url https://general-runtime.voiceflow.com/state/user/{userID} \
--header 'authorization: <api-key>' \
--header 'projectID: <projectid>'import requests
url = "https://general-runtime.voiceflow.com/state/user/{userID}"
headers = {
"projectID": "<projectid>",
"authorization": "<api-key>"
}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {projectID: '<projectid>', authorization: '<api-key>'}};
fetch('https://general-runtime.voiceflow.com/state/user/{userID}', 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}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"authorization: <api-key>",
"projectID: <projectid>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://general-runtime.voiceflow.com/state/user/{userID}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("projectID", "<projectid>")
req.Header.Add("authorization", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://general-runtime.voiceflow.com/state/user/{userID}")
.header("projectID", "<projectid>")
.header("authorization", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://general-runtime.voiceflow.com/state/user/{userID}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["projectID"] = '<projectid>'
request["authorization"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"stack": [
{
"diagramID": "<string>",
"storage": {},
"variables": {},
"nodeID": "<string>",
"name": null,
"commands": [
{
"type": "<string>"
}
],
"dynamicCommands": {}
}
],
"variables": {},
"storage": {},
"turn": {}
}Authorizations
Voiceflow API key
Headers
ID of the target Voiceflow project.
ID or alias of the target environment.
Path Parameters
An ID which uniquely identifies the user having the conversation.
Maximum string length:
128Response
200 - application/json
Hide child attributes
Hide child attributes
Was this page helpful?
⌘I