Web API doesnt work

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 .
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

1 Like

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.

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.

1 Like

Hi,

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

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.

2 Likes

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.

1 Like

This link to the test project is Thunkable. 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.

1 Like

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.

2 Likes

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.

1 Like

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).

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

1 Like

You might consider submitting a bug report 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.

1 Like

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.

1 Like

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.

1 Like

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

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

2 Likes