Vetle Nilsen
Vetle Nilsen2y ago

Unable to fetch response

I get this error message when trying to make an API call with openAI API: "unable to fetch response". Any known issue with a fix?
1 Reply
Tico | Voiceflow Assistant
The error message "unable to fetch response" could be due to a variety of reasons. However, based on the context provided, it seems like you're trying to make an API call using the Voiceflow Fetch API. One important thing to note is that the Voiceflow Fetch API differs slightly from the standard Fetch API. Specifically, the way to access the response body of a fetch request is different. In the standard Fetch API, you would use the .json() method, but in the Voiceflow Fetch API, the response body is available through the .json field. Here's an example:
// Standard Fetch API
const response = await fetch("https://someurl.com");
const responseBody = await response.json();

// Voiceflow Fetch API
const responseBody = (await fetch("https://someurl.com")).json;
// Standard Fetch API
const response = await fetch("https://someurl.com");
const responseBody = await response.json();

// Voiceflow Fetch API
const responseBody = (await fetch("https://someurl.com")).json;
Please ensure that you're using the correct method to access the response body. If the issue persists, it might be related to the specific API you're trying to call or the request parameters. For more information, you can refer to the Voiceflow documentation here.

Did you find this page helpful?