I am trying to write a srcipt to call an API that returns a json transcript.
let audio_url = 'http://abcd.wav';
let language_behaviour = 'automatic multiple languages';
let form = new FormData();
form.append('audio_url', audio_url);
That error is telling you that FormData doesn’t exist. while it is something supported in browsers, it isn’t something available to the JavaScript engine Drafts is utilising.
Drafts provides an HTTP class to interact with web API.
That is typically a server error. But you should check the docs for the API you are using.
I don’t know what the undefined relates to exactly, but something is not defined when it is called for use. It may relate to the 500 error. It may not. I can’t see from your info where in the script that occurs.
Using the append method for the draft is probably the easiest.