Voiceflow PartnersVPVoiceflow Partners
Powered by
breezyB
Voiceflow Partners•2y ago•
3 replies
breezy

API POST to PHP file doesn't do anything

I have created an agent that uses an API to POST data to a PHP file as form data. The PHP file is supposed to take the form data that are passed to it from Voiceflow and create a new row in a sql database. I have tested the PHP file at length, it works great if I pass data to it from an HTML form. However, when I run the agent, and have Voiceflow POST the data to the PHP file nothing happens. The chat interface runs smoothly, no errors, looks like everything worked, but nothing is written to the database. The headers are "Content-Type" and "application/x-www-form-urlencoded", the body is set to "Form Data"", and I am passing one variable. When I test the API in Voiceflow I get:

Body
{
"VF_STATUS_CODE": 200,
"VF_HEADERS": {
"connection": "Upgrade, close",
"content-encoding": "gzip",
"content-length": "2894",
"content-type": "text/html; charset=UTF-8",
"date": "Fri, 21 Jun 2024 23:35:08 GMT",
"server": "Apache",
"upgrade": "h2,h2c",
"vary": "Accept-Encoding",
"x-powered-by": "PHP/7.2.34"
}
}

Headers
content-type
application/json; charset=utf-8

I have worked on this for two days and cannot seem to overcome this problem. The test shows Header as "application/json; charset=utf-8", but in the API Header I entered is "application/x-www-form-urlencoded". Does the Voiceflow API POST JSON objects or form data when I set "Content-Type" to "application/x-www-form-urlencoded"?

I am a novice and may be missing something obvious to other users. Thank you in advance for any advice you can provide.
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

POST api step
uncertain-scarletUuncertain-scarlet / ❓┃ask-a-question
2y ago
API block : POST
uncertain-scarletUuncertain-scarlet / ❓┃ask-a-question
2y ago
how to use POST API call#?
recent-tealRrecent-teal / ❓┃ask-a-question
2y ago
POST API Block test
uncertain-scarletUuncertain-scarlet / ❓┃ask-a-question
2y ago