Voiceflow PartnersVPVoiceflow Partners
Powered by
brilliant-orangeB
Voiceflow Partners•3y ago•
1 reply
brilliant-orange

Voiceflow not seeing HTTP POST request handler's response data

I have a simple php http POST request handler (HANDLER below). When I make a request to it with my own php file , it succeeds and gets the returned status, message and data items that the HANDLER sends. (REQUESTOR OUTPUT below). However, when I call the handler using VoiceFlow's API step, it succeeds, but the response does not contain the status, message and data items, which are in the response I send. (see VOICEFLOW RESPONSE DISPLAY). Why not?

--------------------HANDLER
<?php

// Check if the request method is POST
if ($_SERVER["REQUEST_METHOD"] === "POST") {


// Process the request
$postData = $_POST; // Get the POST data
// Perform any necessary processing or validation

// Generate response
$response = array(
"status" => "success!",
"message" => "Request processed successfully",
"data" => $postData // Return any data as needed
);

// Send JSON response
header('Content-Type: application/json');
echo json_encode($response);
} else {
// Handle other request methods (optional)
http_response_code(405); // Method Not Allowed
echo "This endpoint only accepts POST requests.";
}

?>


--------------------- REQUESTOR OUTPUT
Response: {"status":"success","message":"Request processed successfully","data":{"username":"john","password":"password123"}}



--------------------- VOICEFLOW RESPONSE DISPLAY (no status, message nor data included. why?)


{
"VF_STATUS_CODE": 200,
"VF_HEADERS": {
"connection": "close",
"content-encoding": "gzip",
"content-type": "text/html; charset=UTF-8",
"date": "Fri, 01 Mar 2024 19:28:44 GMT",
"strict-transport-security": "max-age=15724800; includeSubDomains",
"transfer-encoding": "chunked",
"vary": "Accept-Encoding",
"x-powered-by": "PHP/8.1.23"
}
}


included image of API step settings
image.png
Voiceflow Partners banner
Voiceflow PartnersJoin
Exclusive community for Voiceflow Solutions Providers & Content Creators.
13,076Members
Resources
Recent Announcements

Similar Threads

Was this page helpful?
Recent Announcements
jacklyn

# Let your agents search the web 🔎 Hey everyone! We just released the web search tool for the agent step! Your agents can now automatically search the web for information, letting your agent supplement the LLM's knowledge and the data in its knowledge base with live, up-to-date information. Plus.... * You can restrict searches to specific domains, so your agent only searches sites that you own * This is a tool, so you remain in control of when the agent searches the web * Results are automatically summarized in a way that your agent can automatically understand Under the hood, we're using OpenAI's web search API. Give it a try, and let us know what you think! https://docs.voiceflow.com/changelog/native-web-search-tool

jacklyn · 4mo ago

jacklyn

jacklynbiggin's Thread

jacklyn · 4mo ago

hurt-tomato

connor_maclean's Thread

hurt-tomato · 4mo ago

Similar Threads

Problem with data formatting in Voiceflow API block POST request
wispy-yellowWwispy-yellow / ❓┃ask-a-question
2y ago
SOAP API Post Request (Cannot get response)
dry-scarletDdry-scarlet / ❓┃ask-a-question
2y ago
Voiceflow's font not working outside
spotty-amberSspotty-amber / ❓┃ask-a-question
11mo ago
Need Help with capturing data from API Response in Voiceflow
brilliant-limeBbrilliant-lime / ❓┃ask-a-question
2y ago