What is use of Web API

Well, I’ll show you.

1 Like

Many thanks really … just last info: if I have more “row” and I have put them into a listview … which list block I have to do in place of this?

Andrea

It is necessary to use “in list get” with the desired index, if the required field is in the array of objects. The array is what is between the parentheses [and].

1 Like

I am also having trouble with this. Here is the code:

#1 returns blank or “undefined”
#2 blank or “undefined”
#3 is
[{"breed’:||,“catagories”:||,“id”;“egs”,“url”:“https://24.media.tumblr.com/tumblr_m4ikzs7XtT1r6jd7fo1_500.jpg”}]

https://24.media.tumblr.com/tumblr_m4ikzs7XtT1r6jd7fo1_500.jpg is a valid link of a cat picture. The API send a different link every time is is called.

I want to strip out the link and display it in the webviewer, using the property url, which I think should happen at #2, but it doesn’t work. Where am I going wrong?

TIA

In your browser enter https://api.thecatapi.com/v1/images/search and show me the answer. If the answer is no information, then you will not be able to.

I get:

[{“breeds”:[],“categories”:[],“id”:“6st”,“url”:“https://24.media.tumblr.com/tumblr_lgmnhnJbjW1qfyzelo1_500.jpg”}]

and the link in there is good.

The question is - why won’t my Thunkable code extract the property ‘url’ from that?

Because you incorrectly address this field. You are trying to get a field from an object, and the answer is not an object, but an array of one object.

First get the object from the array at index = 1, and only then refer to its url property

I am not sure how to set it up.

Like this?

What do I put in the property boxes? Right now I have url and search.

in list “get object from JSON <- responce”

When I use this, I get undefined.

cat%20api%20code3

“Get object from json” won’t fit into the in list space.

Use blocks “get object from JSON” <- “response”. Connect response via “get object from JSON” block

Happened?

Can you give me a link to the project so that I can do everything myself?

Can u solve the issue…

https://x.thunkable.com/copy/7a4cd21cb1b01aa3fad43aaac66e6056

I understood the problem. This is not a valid JSON format. Therefore it does not work. You must manually process this data. Now I’m busy, but after 3 hours I can make an algorithm, if that suits you.