Status code 400 with Testing Localhost api

I’m testing a simple api on my localhost (localhost:8080), using the VoiceFlow API block. However I’m getting a status code 500, status error. Whenever I do a GET or POST Request.

The api works perfectly in the web browser.

Please help

@angstrom360
What is the API endpoint’s address/name you use in the API block in Voiceflow?

Its a custom endpoint using my local server. Hence the full url is https://localhost:8080/{name}/.
The endpoint works perfectly on Postman and chrome browser. I can make successful GET/POST Request . However when I do on VoiceFlow using the API Block, and says status 400. And yes I already add application/json to the header.

@angstrom360 AFAIK you can’t use localhost or private network addresses when testing API from Voiceflow since your skill’s generated code runs on servers that can’t connect to these addresses (they are never public and accessible from outside unless some extra setup is done to direct TCP/IP traffic to them).

You can use an proxy to expose your localhost, google for ngrok or similar.

1 Like

Alright, this actually works! But I find it pretty silly why I have to go through a proxy, just so it can connect to my api.