harsh-harlequin
harsh-harlequin8mo ago

response.json is not a function

I am now trying to get a successful path on voiceflow after the execution of function for two days now. I can't spot the error. I am using make.com webhook module and webhook response. I will attach full code and all the response
3 Replies
Tico | Voiceflow Assistant
In Voiceflow functions the fetch response is structured a bit differently than in the standard Fetch API—you don’t call response.json() as a method. Instead, the parsed response body is returned directly as the json property. For example, instead of writing:   const responseBody = await response.json(); you should write:   const responseBody = response.json; This change should resolve the "response.json is not a function" error and allow you to properly work with the resulting data, after which you can return your runtime commands (including the successful 'next' path) as needed. For more details on how Voiceflow handles fetch requests in function code, please refer to the documentation: Voiceflow Custom Functions. Let me know if you need any more help!
harsh-harlequin
harsh-harlequinOP8mo ago
It did worked thanks so much
Hugh Fungus
Hugh Fungus4w ago
Just want to note that the API example snippet in the Function block still uses await response.json() - So this is probably still tripping people up to this day. I remember this gotcha from about 1 year ago and it just happened to me again 🤣

Did you find this page helpful?