harsh-harlequin•17mo ago
SOAP API Post Request (Cannot get response)
So i set up a SOAP post request through the API step and it works successfully (meaning i get 200 status) except I cannot get the response to appear. running the post request through make.com I was able to get the request-response as expected but voiceflow only shows this:
{
"VF_STATUS_CODE": 200,
"VF_HEADERS": {
"connection": "close",
"content-encoding": "gzip",
"content-type": "text/xml; charset=utf-8",
"date": "Tue, 23 Apr 2024 12:45:40 GMT",
"kareo-decoded-response-size": "1451",
"server": "Microsoft-IIS/10.0",
"transfer-encoding": "chunked",
"vary": "Accept-Encoding",
"x-powered-by": "ASP.NET"
}
}
could this have something to do with the response being xml? or perhaps encoding? is there anyway to convert the response to json in order for VF to see it?
I have the integration setup that I want through a webhook + http request + webhook response in make.com but it costs a lot more operations than i am hoping for. if I could setup the api post and get the respone in the body that would be perfect.
Anybody have any advice?
5 Replies
It seems like you're trying to handle a SOAP API response in Voiceflow, but you're encountering issues because the response is in XML format. Unfortunately, Voiceflow's API block is designed to handle JSON responses and does not natively support XML.
However, you can use a middleware service to convert the XML response to JSON before it reaches Voiceflow. This can be done using services like AWS Lambda, Google Cloud Functions, or even a custom server where you can write a function to convert the XML to JSON.
Here's a basic example of how you could do this:
1. Set up a serverless function on a platform like AWS Lambda.
2. In this function, make the SOAP API request.
3. When the response is received, use a library or function to convert the XML response to JSON.
4. Return this JSON response from your function.
Then, in Voiceflow, you would call your AWS Lambda function (or whatever service you're using) instead of the SOAP API directly. This way, the response that Voiceflow receives will already be in the JSON format that it can handle.
Remember, the middleware service you choose should be reliable and secure, as it will handle your API responses. Also, there might be costs associated with running such a service, so please consider this in your project budget.
harsh-harlequinOP•17mo ago
is the xml response stored anywhere in voiceflow or discarded because it is xml?
Did you create a webhook response in make.com?
You need to include the response in the body in valid JSON
for VF to read in the data
VF only accepts JSON
harsh-harlequinOP•17mo ago
yes i made a successful webhook response in make it returns the JSON successfully. I am simply trying to figure out if i can convert the xml received from the request to JSON and return that, natively in VF? it doesn't sound like i can do much with xml in VF will there be support for that in the future?
trying to reduce operations in make.
You can convert it in Make and return JSON
I believe