# Trouble Using WhisperAPI

**URL:** https://community.thunkable.com/t/trouble-using-whisperapi/2241275
**Category:** Web API's
**Tags:** beginner
**Created:** [January 25, 2023, 10:57pm UTC](https://community.thunkable.com/t/trouble-using-whisperapi/2241275 "2023-01-25T22:57:42Z")
**Posts on this page:** 20
**Page:** 1

<div class="post-metadata">

### Author: ![nathanburley21656](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/nathanburley21656/32/150307_2.png) [@nathanburley21656](https://community.thunkable.com/u/nathanburley21656)
#### Post date: [January 25, 2023, 10:57pm UTC](https://community.thunkable.com/t/trouble-using-whisperapi/2241275/1 "2023-01-25T22:57:42Z")

</div>

I’m trying to connect my app to [WhisperAPI.com](http://WhisperAPI.com) which hosts a version of OpenAI’s whisper for voice to test transcription. I’ve got voice recording working and I can pull a url for the MP4 from Cloudinary but I get nothing from the web API.

Here’s what the documentation says:

 ![thunk8](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/6/9/69e6590e4d345e1261767c42348bb80f703000ef.jpeg)

Here’s what I’m currently doing:  
 ![Thunk9](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/5/7/5771662bc42ff5e16a700fdb42a4d2e7500f2b29.jpeg)

 ![Thunk10](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/2/3/23a4f54faa00d693a04252023934509d85e505aa.jpeg)

I’m sure I’m getting the JSON part wrong but I’m not sure where to start error checking here.

---

<div class="post-metadata">

### Author: ![tatiang](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/tatiang/32/55482_2.png) [@tatiang](https://community.thunkable.com/u/tatiang)
#### Post date: [January 25, 2023, 11:58pm UTC](https://community.thunkable.com/t/trouble-using-whisperapi/2241275/2 "2023-01-25T23:58:49Z")

</div>

I’m pretty sure your object needs to be part of the Body, not the Query Parameters. And you’ll need to convert it to JSON like this example from one of my projects:

 ![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/9/0/90ba33b2c50b8bfa2764ea19d14dfd1e2df7040a.png)

Also, as you test an API, it’s best to do error handling. Inside of the `Post` call’s “then do” section, set it up with an If block: If [error] then set label’s text to [error]; else set label’s text to [response].

Lastly, the “fileType” property may be case-sensitive so I would fix that. [This info](https://learn.microsoft.com/en-us/onedrive/developer/rest-api/concepts/case-sensitivity?view=odsp-graph-online) from Microsoft states that at least for their specific API, body properties _are_ case-sensitive.

Report back the error value you’re seeing and/or the response value you’re seeing. While testing, it can be useful to replace the label with a text input component because then you can copy & paste the displayed text rather than having to screenshot it.

---

<div class="post-metadata">

### Author: ![nathanburley21656](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/nathanburley21656/32/150307_2.png) [@nathanburley21656](https://community.thunkable.com/u/nathanburley21656)
#### Post date: [January 30, 2023, 11:04am UTC](https://community.thunkable.com/t/trouble-using-whisperapi/2241275/3 "2023-01-30T11:04:02Z")

</div>

OK - back from holiday (sorry for the slow response).  
I’ve tweaked the sections you mentioned (still need to get used to capitalisation conventions). I stripped out some of the error checking to try and simplify it when I was troubleshooting as I had seen one instance of an error check causing an issue. Anyway, here’s what I’m working with now. The error I get back say there’s no url or file sent (it wants one or the other, but not both). I can clearly see the url flash up before the error though so I don’t know why it’s not happy

 ![Thunk11](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/b/6/b6d0efd8905d2e224cafc183c31b07ffc61fa4f8.jpeg)

---

<div class="post-metadata">

### Author: ![nathanburley21656](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/nathanburley21656/32/150307_2.png) [@nathanburley21656](https://community.thunkable.com/u/nathanburley21656)
#### Post date: [January 30, 2023, 11:14am UTC](https://community.thunkable.com/t/trouble-using-whisperapi/2241275/4 "2023-01-30T11:14:25Z")

</div>

The actual error - in case formatting infers syntax is: {“error”:“Neither URL was set nor file was sent!”}  
If I run in a browser it gives me: “Failed to fetch data. Please test on a device or contact support.”

It still does this even if I hardcode the url into the JSON block instead of using an app variable or green ‘url’ block

---

<div class="post-metadata">

### Author: ![tatiang](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/tatiang/32/55482_2.png) [@tatiang](https://community.thunkable.com/u/tatiang)
#### Post date: [January 30, 2023, 11:15am UTC](https://community.thunkable.com/t/trouble-using-whisperapi/2241275/5 "2023-01-30T11:15:31Z")

</div>

What happens if you remove the “file” property from the object?

 ![Image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/d/a/daed1d4ea4e9951a5f1cb256127888769c84113a.jpeg)

---

<div class="post-metadata">

### Author: ![nathanburley21656](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/nathanburley21656/32/150307_2.png) [@nathanburley21656](https://community.thunkable.com/u/nathanburley21656)
#### Post date: [January 30, 2023, 11:18am UTC](https://community.thunkable.com/t/trouble-using-whisperapi/2241275/6 "2023-01-30T11:18:25Z")

</div>

Yeh, great minds. I just tried that too and it made no difference.  
I also tried changing the Query Params into Body and it gives me a “Network Request Failed”

---

<div class="post-metadata">

### Author: ![nathanburley21656](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/nathanburley21656/32/150307_2.png) [@nathanburley21656](https://community.thunkable.com/u/nathanburley21656)
#### Post date: [January 30, 2023, 11:19am UTC](https://community.thunkable.com/t/trouble-using-whisperapi/2241275/7 "2023-01-30T11:19:28Z")

</div>

So, I’m guessing Query Parameters is correct. It just doesn’t think I’ve added a url in. I wonder if it’s not correctly formatted. Or, if Thunkable is changing the format given the type of variable I’m using?

---

<div class="post-metadata">

### Author: ![nathanburley21656](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/nathanburley21656/32/150307_2.png) [@nathanburley21656](https://community.thunkable.com/u/nathanburley21656)
#### Post date: [January 30, 2023, 11:23am UTC](https://community.thunkable.com/t/trouble-using-whisperapi/2241275/8 "2023-01-30T11:23:13Z")

</div>

If I just do this:

 ![Thunk12](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/4/8/48907964467ea61bb087702ba3de496d4494729e.jpeg)

It says my variable is just [object Oject] which i guess means my JSON contains nothing 😕

---

<div class="post-metadata">

### Author: ![ioannis](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/ioannis/32/146956_2.png) [@ioannis](https://community.thunkable.com/u/ioannis)
#### Post date: [January 30, 2023, 11:23am UTC](https://community.thunkable.com/t/trouble-using-whisperapi/2241275/9 "2023-01-30T11:23:42Z")

</div>

@nathanburley21656  
Did you test it using the Thunkable live app?  
Maybe this error is on the web app

---

<div class="post-metadata">

### Author: ![nathanburley21656](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/nathanburley21656/32/150307_2.png) [@nathanburley21656](https://community.thunkable.com/u/nathanburley21656)
#### Post date: [January 30, 2023, 11:24am UTC](https://community.thunkable.com/t/trouble-using-whisperapi/2241275/10 "2023-01-30T11:24:47Z")

</div>

Yeh it doesn’t work at all in the Web App. I’m now running it on my OnePlus 8 Pro (android 13)

---

<div class="post-metadata">

### Author: ![nathanburley21656](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/nathanburley21656/32/150307_2.png) [@nathanburley21656](https://community.thunkable.com/u/nathanburley21656)
#### Post date: [January 30, 2023, 11:31am UTC](https://community.thunkable.com/t/trouble-using-whisperapi/2241275/11 "2023-01-30T11:31:59Z")

</div>

OK - so if I try to output the contents of the variable without doing a ‘get object from JSON’ I get the contents. But I’m not 100% sure it’s formatted correctly:

{“data”:{“fileType”:“mp4”,“url”:“[https://res.cloudinary.com/dovla2494/video/upload/v1675076959/l2jlcs8tnc99fm1wsxud.mp4",“language”:“en”,“task”:"transcribe](https://res.cloudinary.com/dovla2494/video/upload/v1675076959/l2jlcs8tnc99fm1wsxud.mp4%22,%22language%22:%22en%22,%22task%22:%22transcribe)”}}

^^ Is this the correct format?

Needs to match this:

 ![thunk8](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/6/9/69e6590e4d345e1261767c42348bb80f703000ef.jpeg)

---

<div class="post-metadata">

### Author: ![tatiang](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/tatiang/32/55482_2.png) [@tatiang](https://community.thunkable.com/u/tatiang)
#### Post date: [January 30, 2023, 11:47am UTC](https://community.thunkable.com/t/trouble-using-whisperapi/2241275/12 "2023-01-30T11:47:39Z")

</div>

I replaced the smart quotes\* in that JSON response and pasted it into [https://codebeautify.org/jsonviewer](https://codebeautify.org/jsonviewer) to see the JSON structure.

 ![1D73F490-3A2B-4C80-A905-BEB02E52FEB2](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/1/d/1dc9738faeeecdee6c4628f4858cece69a54a93b.jpeg)

That allows me to see that you can get the url by getting the property “data.url” of that object.

\*To avoid having to do this, always use this forums toolbar button to format the text:

 ![941A86F2-E222-41DD-AF99-D84B89A40D05](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/9/1/91da76a42d41b18fb3dfe298c7276587c19ce191.jpeg)

---

<div class="post-metadata">

### Author: ![nathanburley21656](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/nathanburley21656/32/150307_2.png) [@nathanburley21656](https://community.thunkable.com/u/nathanburley21656)
#### Post date: [January 30, 2023, 11:57am UTC](https://community.thunkable.com/t/trouble-using-whisperapi/2241275/13 "2023-01-30T11:57:16Z")

</div>

OK the cause doesn’t surprise me. When I posted the JSON in above I did wonder why it had highlighted as it had.

I’m a bit fuzzy on whether the JSON I’m building in the app is correct though and whether there’s anything I can do to make this right.

---

<div class="post-metadata">

### Author: ![nathanburley21656](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/nathanburley21656/32/150307_2.png) [@nathanburley21656](https://community.thunkable.com/u/nathanburley21656)
#### Post date: [January 30, 2023, 12:02pm UTC](https://community.thunkable.com/t/trouble-using-whisperapi/2241275/14 "2023-01-30T12:02:59Z")

</div>

And - in case it’s relevant, the error I’m getting is coming from the API’s response, not the actual error. Status is reading 200. I’m wondering if it actually doesn’t accept MP4’s. list of acceptable files isn’t in the documentation 😕

---

<div class="post-metadata">

### Author: ![nathanburley21656](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/nathanburley21656/32/150307_2.png) [@nathanburley21656](https://community.thunkable.com/u/nathanburley21656)
#### Post date: [January 30, 2023, 12:06pm UTC](https://community.thunkable.com/t/trouble-using-whisperapi/2241275/15 "2023-01-30T12:06:36Z")

</div>

Nope - no dice there either. Converted to mp3 and re-tested. Hardcoded the url too and still no dice. Checked the output of the JSON again and it looks OK. I’ve pinged the API devs to see what they say too.

---

<div class="post-metadata">

### Author: ![tatiang](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/tatiang/32/55482_2.png) [@tatiang](https://community.thunkable.com/u/tatiang)
#### Post date: [January 30, 2023, 3:10pm UTC](https://community.thunkable.com/t/trouble-using-whisperapi/2241275/16 "2023-01-30T15:10:34Z")

</div>

Sorry, it’s actually hard to help you troubleshoot when you’ve taken a couple different approaches. Looking over your last screenshots, I realize that all you did is to display the JSON for the object you created. You didn’t actually do a Post call to the API and get a response.

That’s why the JSON contains an .mp4 of your voice saying “testing, testing, transcribe.”

Can you post a screenshot of the current blocks you’re using to call the API?

---

<div class="post-metadata">

### Author: ![nathanburley21656](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/nathanburley21656/32/150307_2.png) [@nathanburley21656](https://community.thunkable.com/u/nathanburley21656)
#### Post date: [January 30, 2023, 3:23pm UTC](https://community.thunkable.com/t/trouble-using-whisperapi/2241275/17 "2023-01-30T15:23:11Z")

</div>

Sorry for the confusion - I’ve been back and forth trying to troubleshoot everything I could think of for hours now. Here’s what I’m currently running:

 ![Thunk13](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/4/3/43a5ecdae544757c100bf0a8dcbf1ea1dfc75857.jpeg)

I’m thinking it’s got to be the format of the JSON I’m actually uploading, not being what the API wants to see. Something to do with the file ={} and data = {} sections perhaps?

---

<div class="post-metadata">

### Author: ![tatiang](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/tatiang/32/55482_2.png) [@tatiang](https://community.thunkable.com/u/tatiang)
#### Post date: [January 30, 2023, 3:50pm UTC](https://community.thunkable.com/t/trouble-using-whisperapi/2241275/18 "2023-01-30T15:50:14Z")

</div>

Can you try switching from QueryParameters to Body again and test it on a phone? What error do you get, if any?

And with it set again to QueryParameters, what error are you seeing on a phone?

---

<div class="post-metadata">

### Author: ![nathanburley21656](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/nathanburley21656/32/150307_2.png) [@nathanburley21656](https://community.thunkable.com/u/nathanburley21656)
#### Post date: [January 30, 2023, 3:56pm UTC](https://community.thunkable.com/t/trouble-using-whisperapi/2241275/19 "2023-01-30T15:56:27Z")

</div>

So, I’m always testing it on a phone now as it doesn’t work at all on a web app.

With it set to Body it give a Network Request Failed  
With it set to QueryParams again it says {“error”:“Neither URL was set nor file was sent!”}

---

<div class="post-metadata">

### Author: ![nathanburley21656](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/nathanburley21656/32/150307_2.png) [@nathanburley21656](https://community.thunkable.com/u/nathanburley21656)
#### Post date: [January 30, 2023, 4:00pm UTC](https://community.thunkable.com/t/trouble-using-whisperapi/2241275/20 "2023-01-30T16:00:13Z")

</div>

Also, got a reply from the devs saying:  
_I think your issue may be that you need to include all the -F parameters in the header. Here is a thunkable post that explains a bit:_

> [@How do I convert cURL syntax to thunkable?](https://community.thunkable.com/t/how-do-i-convert-curl-syntax-to-thunkable/1872067/9):
>
> i think the api-key has no limit - i’ve used it in and out of postman several times for 2 days and i get 200 return codes (see below) for the same reason i think the same api-key should also work in thunkable. but i can’t seem to make thunkable to do this. i’ve tried your suggestion, and other settings. can you (@muneer or anyone else) try to make my project (see below) work? thanks. here’s my postman screenshots and the link to the output: https://api.deepai.org/job-…

This seems to suggest they’re using curl to do the API request, which I’m not. I tried adding all the parameters to the header instead and then it doesn’t have authorisation. I then tried adding the API key into the API POST call JSON as a separate JSON parameter but that didn’t work either {sigh}

[Next page](https://community.thunkable.com/t/trouble-using-whisperapi/2241275.md?page=2)
