Using WebAPI-GET for localhost

Message

Alright, so I’ve made a PHP JSON Application that interacts with MySQL on localhost.
I’m using WebAPI-GET to call the JSON API and make it an object in Thunkable so I can show the details.

I’ve added 2 vibrates to check where my problem is and only the FIRST Vibrate function works and I’m expecting all of the vibrates to vibrate and show the detail from the API.

So I’m wondering if this is kind of LOCALHOST problem? Like Thunkable wants the link to be SSL Secured…


Code

image


~ ItsBenny

@DevItsBenny, Have you tried showing the values of the 'status', 'error' and 'response' blocks of the WebAPI-Get call (e.g. in a Label or Alert)? Those values should give you some clue as to what the problem is.

-Mark

1 Like

Yes, I have tried 'status' and 'error'
This is what I get:

Status: 200
Error: undefined
Response: {<insert-json>}

But when I try to make them Object and use GetProperties block and add the name I get no value?

Is the response literally the string “{<insert-json>}”? If so, that is not a valid JSON string and therefore the 'get object from JSON' block won’t be able to convert it to an object. You’ll have to make sure that your PHP server returns proper JSON.

-Mark

Thanks, found my problem!
It wasn’t literally the string "{<insert-json>}" I did get the response but it wasn’t proper JSON (Application/JSON).

-ItsBenny