# Web API doesnt work

**URL:** <https://community.thunkable.com/t/web-api-doesnt-work/1520209>\
**Category:** Questions about Thunkable X\
**Tags:** beginner\
**Created:** [September 22, 2021, 2:50pm UTC](https://community.thunkable.com/t/web-api-doesnt-work/1520209 "2021-09-22T14:50:20Z")\
**Posts on this page:** 14\
**Page:** 1

<div class="post-metadata">

**Author:** ![Menschlich](https://avatars.discourse-cdn.com/v4/letter/m/b77776/32.png) [@Menschlich](https://community.thunkable.com/u/Menschlich)\
**Post date:** [September 22, 2021, 2:50pm UTC](https://community.thunkable.com/t/web-api-doesnt-work/1520209/1 "2021-09-22T14:50:20Z")

</div>

Hi,  
I am completely new to thunkable, but I had a closer look at the docs of the Web API and also tried to follow this tutorial: [Web API - Thunkable Drag and Drop UI - YouTube](https://www.youtube.com/watch?v=FxrXdZPRTLw) .  
Unfortunately, it doesn’t work at all!  
I followed the youtube video step by step but nothing happens when I press on the “shorten” button.

Here is a link of my “test” project:  
[https://x.thunkable.com/copy/7172a0114140008f6a38a9e49c174cf8](https://x.thunkable.com/copy/7172a0114140008f6a38a9e49c174cf8)

---

<div class="post-metadata">

**Author:** ![muneer](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/muneer/32/75210_2.png) [@muneer](https://community.thunkable.com/u/muneer)\
**Post date:** [September 22, 2021, 3:08pm UTC](https://community.thunkable.com/t/web-api-doesnt-work/1520209/2 "2021-09-22T15:08:46Z")

</div>

Can you explain what doesn’t work.

Remember, most API servers work from the phone not from the computer.

I just ran your app on my phone and this is the outcome.

 ![Screenshot_2021-09-22-18-06-59-75_2bbfbfee96a5dfce998f962ebb8b5da3](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/e/0/e0021c350ba9873f7c978a63ce78e1be57fe1a05.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:** [September 22, 2021, 4:42pm UTC](https://community.thunkable.com/t/web-api-doesnt-work/1520209/3 "2021-09-22T16:42:07Z")

</div>

I also noticed it works on a phone in Thunkable Live but not in a browser. That API also seems to take a long time to generate a response. It has taken up to 10 seconds for me.

---

<div class="post-metadata">

**Author:** ![fellowship.devs](https://avatars.discourse-cdn.com/v4/letter/f/bc79bd/32.png) [@fellowship.devs](https://community.thunkable.com/u/fellowship.devs)\
**Post date:** [November 5, 2021, 7:56pm UTC](https://community.thunkable.com/t/web-api-doesnt-work/1520209/4 "2021-11-05T19:56:36Z")

</div>

Hi,

I also have the same issue as op. What does the below mean?

> [@muneer](#):
>
> most API servers work from the phone not from the computer

I have the same app, one is drag & drop and the other isn’t. I am able to test the “not drag and drop” one on the browser, but the “drag and drop” doesn’t work. Both work on my phone.

It’s a bit of an issue if I can’t test API calls on the browser as I’m developing the app.

Thanks for the help.

---

<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:** [November 5, 2021, 9:22pm UTC](https://community.thunkable.com/t/web-api-doesnt-work/1520209/5 "2021-11-05T21:22:42Z")

</div>

I’m not sure _why_ many APIs don’t work when previewed from Thunkable in a browser but they don’t. You’ll need to check and most likely do your testing on a mobile device.

Without seeing your project or screenshots of your blocks, there’s no way we can help you troubleshoot this.

If the API call works as a url in a browser then it should be possible to get it to work using blocks in Thunkable in either the older Snap to Place interface or the newer Drag and Drop interface.

---

<div class="post-metadata">

**Author:** ![fellowship.devs](https://avatars.discourse-cdn.com/v4/letter/f/bc79bd/32.png) [@fellowship.devs](https://community.thunkable.com/u/fellowship.devs)\
**Post date:** [November 6, 2021, 12:03am UTC](https://community.thunkable.com/t/web-api-doesnt-work/1520209/6 "2021-11-06T00:03:42Z")

</div>

This link to the test project is [Thunkable](https://x.thunkable.com/projectPage/61857eda02dc190011c5ccb2). The thing is, the API call works fine when you preview it in that link. But when I’m inside the project and do the “Web Preview”, it doesn’t work at all. Quite frustrating.

---

<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:** [November 6, 2021, 1:21am UTC](https://community.thunkable.com/t/web-api-doesnt-work/1520209/7 "2021-11-06T01:21:42Z")

</div>

I can see the API response on my iPhone in Thunkable Live but not when previewing the project in a web browser. So that’s the limitation. You can contact Thunkable Staff to find out why. I’d be interested to know. There may be a forum post about it but you’d have to search a bit.

**Edit:** then again, I just opened your link a second time and was able to see the response in a browser. Hmm.

 ![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/2/7/27249770835af3ab6b0ac79002fd01526cf12f59.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:** [November 6, 2021, 1:24am UTC](https://community.thunkable.com/t/web-api-doesnt-work/1520209/8 "2021-11-06T01:24:50Z")

</div>

I’m beginning to think that API is unreliable. I sometimes get no response on my phone or when previewing but I also just got no response using the url in a browser. Oh wait, it took like 20 seconds. That’s a SLOW response for an API.

---

<div class="post-metadata">

**Author:** ![fellowship.devs](https://avatars.discourse-cdn.com/v4/letter/f/bc79bd/32.png) [@fellowship.devs](https://community.thunkable.com/u/fellowship.devs)\
**Post date:** [November 6, 2021, 2:20am UTC](https://community.thunkable.com/t/web-api-doesnt-work/1520209/9 "2021-11-06T02:20:10Z")

</div>

As I had mentioned, the project preview (which is the link that you tested) works fine. That wasn’t the issue.

What doesn’t work is the “Web Preview” inside my project. This official video from Thunkable shows the Web Preview working fine, with the same api I used ([video here](https://www.youtube.com/watch?v=FxrXdZPRTLw)).

In the GIF below, you can see how the request is fired in the “non-drag & drop” version, whereas in the “drag & drop” it doesn’t.

That is the issue: according to the tutorial video, the web preview should work. As you can see, it doesn’t.

Am I missing something?

![ezgif-4-62e102218d97](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/4/7/473094466182be45224b630a0a2595dd41f93735.gif)

---

<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:** [November 6, 2021, 4:40am UTC](https://community.thunkable.com/t/web-api-doesnt-work/1520209/10 "2021-11-06T04:40:07Z")

</div>

You might consider submitting a [bug report](https://docs.thunkable.com/bugs-and-feature-requests) because clearly that’s not working as intended. I just take it for granted that Web APIs have to be tested on a mobile device but maybe you’ll get somewhere with this.

I also noticed that it **does** work when published as a web app. So it’s just the preview that’s the problem.

---

<div class="post-metadata">

**Author:** ![muneer](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/muneer/32/75210_2.png) [@muneer](https://community.thunkable.com/u/muneer)\
**Post date:** [November 6, 2021, 7:24am UTC](https://community.thunkable.com/t/web-api-doesnt-work/1520209/11 "2021-11-06T07:24:16Z")

</div>

The `Preview button` in the design page of StP and the `Preview menu option` in DnD both have lots of bugs.

Try a simple thing in StP such as showing an `alert` message and click the `Preview button`, you will notice that the alert will not show. If you use the `Test menu option`, it will work as intended.

---

<div class="post-metadata">

**Author:** ![alex\_ezacae](https://avatars.discourse-cdn.com/v4/letter/a/278dde/32.png) [@alex\_ezacae](https://community.thunkable.com/u/alex_ezacae)\
**Post date:** [November 6, 2021, 3:17pm UTC](https://community.thunkable.com/t/web-api-doesnt-work/1520209/12 "2021-11-06T15:17:30Z")

</div>

yes same issue on my side.  
the preview worked but not anymore.  
I am using the solution of @muneer using directly the play button on the projects dashboard. It is working better.

Becarefull you can have a time for the update of the app. It happens to me often the preview do not run with the latest changes.

---

<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:** [November 6, 2021, 3:39pm UTC](https://community.thunkable.com/t/web-api-doesnt-work/1520209/13 "2021-11-06T15:39:24Z")

</div>

> [@alex\_ezacae](#):
>
> I am using the solution of @muneer using directly the play button on the projects dashboard. It is working better.

Oh interesting… that does work to show the API response for @fellowship.devs’ project.

> [@alex\_ezacae](#):
>
> Becarefull you can have a time for the update of the app. It happens to me often the preview do not run with the latest changes.

That’s true. I usually have to press the preview button at least twice to get the newest changes to show.

---

<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:** [November 8, 2024, 1:15pm UTC](https://community.thunkable.com/t/web-api-doesnt-work/1520209/14 "2024-11-08T13:15:06Z")

</div>


