Has anything changed with the Web API in web preview?

So I have seen some other posts talking about issues, though my specific problem is to do with the Web API. My blocks were all working with each request as intended a few days ago, however, when testing today they only work sometimes through the live test, and they just completely fail when I try it through the web app.

Is/has anyone else faced these issues?

1 Like

Are you on the latest Live App in your phone. It should be version 284.

1 Like

Thanks for metnioning, I just checked the app store and I have no prompt to update, but my version is 283.

1 Like

Please update to the latest and this issue should disappear.

1 Like

Thanks again Muneer, currently the only version I can see is still 283 but I’ll keep a look out.

1 Like

This is 284

1 Like

This doesn’t sound like an issue with Thunkable Live to me if it’s happening in Web Preview.

What API are you connecting to, are there any rate limits in place?

Are you doing any error handling in your blocks?


284 is out for Android already but v283-5 seems to be the latests for iOS, as far as I can see anyway.


1 Like

hi, i have the same feeling. In my app yesterday the webapi was working like a sharm. Today fails to sent post data to a php page. I have IOs and 283 release. Cannot find the 284
tks

Yes, for iOS. I have 283. Yesterday my app was working fine sending post data to a php page. Today, without any code change it stops working. Data (textbox data and variable data) are not received by the php page!
Roberto

Update: i just tried to do some debug … using webapi POST. image

the response contains the answer of the PHP page (an error …due post data are null). The php page and this part of the code were working fine 2 days ago and yesterday. The issue seems to be evident since this early morning.

Roberto

2 Likes

@domhnallohanlon

It’s not for the web preview, the issue is happening with the web app (I published as a Web App Pro). The API limits aren’t being exceeded and yes there is error handling at every single step. Here is what was happening:

Live Preview: Even with the updated version (IOS), I would click the button to begin the API POST call, and it would give me the error from the error handler sometimes, and sometimes it would execute the post, and sometimes it would fail somewhere in the middle.

Live Preview (android): Worked perfectly fine and executed in each attempt, although I had to borrow someone else’s phone (Xiaomi mi9 in case that affects why it was working)

Web App: I open the link to the web app (I tried both responsive web app and mobile web app) and it when I press button to trigger the API POST, it would always fail.

I tried those all a few times, just to make sure it was not something to do with the net or my blocks. I got the apk and apple build installed as apps on phones as well which also worked every time which is why I suspect the issue is mainly with the web app but I can’t quite figure out why.

2 Likes

@sirfrancisdrake

So I made a fresh poject and tried mine again, it’s a bit odd. The pictures below are for the orange button as a trigger (testing getting a random 4 digit code), the request is an API GET.

Live Preview (desktop) - failed

Live Test (Mobile - Thunkable Live IOS - Current up-to-date version) - success

Responsive & Mobile Web App (Desktop - Chrome & Edge) - failed

Responsive & Mobile Web App (Mobile - iPhone - Safari & Chrome) - failed

Since it’s a get request, I also tried it in the browser - success

So basically it’s all over the place but we can focus on the web app and live test results. It looks like for the random number api, the lack of proper SSL causes the error on the web app for both phone and desktop. So I changed it to a different api that has SSL and this problem disappeared. This solution seems like it’s case specific (GET request and SSL however, so I am not sure if it can solve the problem your having unfortunately.

For the API POST (blue button), I just didn’t add screenshots mainly since it’s for a local payment gateway, but it is now only working so long as the request comes from a phone (web app and live preview) which I suspect may be something from their end. Could it be the same for you since yours is also an API POST?

I think domhnallohanlon was correct in stating that it is not a thunkable problem.

I dont have experience with .php responses, though I am willing to try testing yours out so long as there’s no API keys/secrets/tokens involved.

3 Likes

tks @kareem
this evening i will develop some php code and a simple app to test and eventually share with you the result…
the app i developed few days ago is still working fine on my ipad but fails on iphone. I didnt change the code

1 Like

hello all, i got the solution. I don’t know if in the meanwhile webapi block has been fixedup by thunkable team but i found a workaround!!

I usually setup the body variable for the POST using a text join block, adding everything is needed.
image

Then i add the block webapi POST …
image
retrieving the response sent by the php page.

This procedure was working fine in different apps until yersterday but then start to randomically fails.

After some test i found that it is working fine again if i put the join text (representing the body parameters) into a temp string variable, give some time (not sure about this), and then put the tempstr into the body parameter to finally fire the POST.

image

This works form me… i hope this will help to find a good fix for the webapi block!! i’m going to extensively check this workaround…

4 Likes

Nice to hear that you found a solution, good luck with the rest of your development!

1 Like

half of solution… one of my post block is still not responding even if i applied the trick! :-’(

Found the full solution. I had to exchange data using a temp variable for body and add a wait time before and after the code of POST block “then do”
image

hope this will help …

2 Likes