# What is use of Web API

**URL:** <https://community.thunkable.com/t/what-is-use-of-web-api/31258>\
**Category:** Questions about Thunkable X\
**Created:** [June 12, 2018, 7:55am UTC](https://community.thunkable.com/t/what-is-use-of-web-api/31258 "2018-06-12T07:55:55Z")\
**Posts on this page:** 20\
**Page:** 2

<div class="post-metadata">

**Author:** ![actech](https://avatars.discourse-cdn.com/v4/letter/a/3d9bf3/32.png) [@actech](https://community.thunkable.com/u/actech)\
**Post date:** [June 15, 2018, 7:45am UTC](https://community.thunkable.com/t/what-is-use-of-web-api/31258/21 "2018-06-15T07:45:29Z")

</div>

Well, I’ll show you.

---

<div class="post-metadata">

**Author:** ![actech](https://avatars.discourse-cdn.com/v4/letter/a/3d9bf3/32.png) [@actech](https://community.thunkable.com/u/actech)\
**Post date:** [June 15, 2018, 8:03am UTC](https://community.thunkable.com/t/what-is-use-of-web-api/31258/22 "2018-06-15T08:03:49Z")

</div>

![json1](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/f/8/f8e826e992bf6b3d13154794ae015c5791e62c35.png)

---

<div class="post-metadata">

**Author:** ![Andrea\_Marchisio](https://avatars.discourse-cdn.com/v4/letter/a/e274bd/32.png) [@Andrea\_Marchisio](https://community.thunkable.com/u/Andrea_Marchisio)\
**Post date:** [June 15, 2018, 10:21am UTC](https://community.thunkable.com/t/what-is-use-of-web-api/31258/23 "2018-06-15T10:21:05Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![actech](https://avatars.discourse-cdn.com/v4/letter/a/3d9bf3/32.png) [@actech](https://community.thunkable.com/u/actech)\
**Post date:** [June 15, 2018, 11:10am UTC](https://community.thunkable.com/t/what-is-use-of-web-api/31258/24 "2018-06-15T11:10:40Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Lin](https://avatars.discourse-cdn.com/v4/letter/l/13edae/32.png) [@Lin](https://community.thunkable.com/u/Lin)\
**Post date:** [November 5, 2018, 6:30pm UTC](https://community.thunkable.com/t/what-is-use-of-web-api/31258/25 "2018-11-05T18:30:07Z")

</div>

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

 ![cat%20api%20code](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/f/0/f0e39d9d8505862cf0f7ff278cdd1e1d82b203de.png)

#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)”}]

[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

---

<div class="post-metadata">

**Author:** ![actech](https://avatars.discourse-cdn.com/v4/letter/a/3d9bf3/32.png) [@actech](https://community.thunkable.com/u/actech)\
**Post date:** [November 6, 2018, 6:54am UTC](https://community.thunkable.com/t/what-is-use-of-web-api/31258/26 "2018-11-06T06:54:48Z")

</div>

In your browser enter [https://api.thecatapi.com/v1/images/search](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.

---

<div class="post-metadata">

**Author:** ![Lin](https://avatars.discourse-cdn.com/v4/letter/l/13edae/32.png) [@Lin](https://community.thunkable.com/u/Lin)\
**Post date:** [November 6, 2018, 1:43pm UTC](https://community.thunkable.com/t/what-is-use-of-web-api/31258/27 "2018-11-06T13:43:52Z")

</div>

I get:

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

and the link in there is good.

---

<div class="post-metadata">

**Author:** ![Lin](https://avatars.discourse-cdn.com/v4/letter/l/13edae/32.png) [@Lin](https://community.thunkable.com/u/Lin)\
**Post date:** [November 6, 2018, 1:48pm UTC](https://community.thunkable.com/t/what-is-use-of-web-api/31258/28 "2018-11-06T13:48:05Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![actech](https://avatars.discourse-cdn.com/v4/letter/a/3d9bf3/32.png) [@actech](https://community.thunkable.com/u/actech)\
**Post date:** [November 6, 2018, 2:22pm UTC](https://community.thunkable.com/t/what-is-use-of-web-api/31258/29 "2018-11-06T14:22:02Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Lin](https://avatars.discourse-cdn.com/v4/letter/l/13edae/32.png) [@Lin](https://community.thunkable.com/u/Lin)\
**Post date:** [November 6, 2018, 3:15pm UTC](https://community.thunkable.com/t/what-is-use-of-web-api/31258/30 "2018-11-06T15:15:14Z")

</div>

I am not sure how to set it up.

Like this?

 ![cat%20api%20code2](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/e/1/e1807521e7945945a0d4e2c975b71a2fcb435f08.png)

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

---

<div class="post-metadata">

**Author:** ![actech](https://avatars.discourse-cdn.com/v4/letter/a/3d9bf3/32.png) [@actech](https://community.thunkable.com/u/actech)\
**Post date:** [November 6, 2018, 3:17pm UTC](https://community.thunkable.com/t/what-is-use-of-web-api/31258/31 "2018-11-06T15:17:36Z")

</div>

in list “get object from JSON \<- responce”

---

<div class="post-metadata">

**Author:** ![Lin](https://avatars.discourse-cdn.com/v4/letter/l/13edae/32.png) [@Lin](https://community.thunkable.com/u/Lin)\
**Post date:** [November 6, 2018, 3:23pm UTC](https://community.thunkable.com/t/what-is-use-of-web-api/31258/32 "2018-11-06T15:23:48Z")

</div>

When I use this, I get undefined.

![cat%20api%20code3](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/b/1/b1684d180cb656667a132c66ca081f3f34afbe13.png)

---

<div class="post-metadata">

**Author:** ![Lin](https://avatars.discourse-cdn.com/v4/letter/l/13edae/32.png) [@Lin](https://community.thunkable.com/u/Lin)\
**Post date:** [November 6, 2018, 3:24pm UTC](https://community.thunkable.com/t/what-is-use-of-web-api/31258/33 "2018-11-06T15:24:54Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![actech](https://avatars.discourse-cdn.com/v4/letter/a/3d9bf3/32.png) [@actech](https://community.thunkable.com/u/actech)\
**Post date:** [November 6, 2018, 3:25pm UTC](https://community.thunkable.com/t/what-is-use-of-web-api/31258/34 "2018-11-06T15:25:17Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![actech](https://avatars.discourse-cdn.com/v4/letter/a/3d9bf3/32.png) [@actech](https://community.thunkable.com/u/actech)\
**Post date:** [November 6, 2018, 3:28pm UTC](https://community.thunkable.com/t/what-is-use-of-web-api/31258/35 "2018-11-06T15:28:06Z")

</div>

Happened?

---

<div class="post-metadata">

**Author:** ![Lin](https://avatars.discourse-cdn.com/v4/letter/l/13edae/32.png) [@Lin](https://community.thunkable.com/u/Lin)\
**Post date:** [November 6, 2018, 3:28pm UTC](https://community.thunkable.com/t/what-is-use-of-web-api/31258/36 "2018-11-06T15:28:22Z")

</div>

![cat%20api%20code4](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/3/d/3d30da1079e597cc9f5458cc079ba789546a72da.png)

---

<div class="post-metadata">

**Author:** ![actech](https://avatars.discourse-cdn.com/v4/letter/a/3d9bf3/32.png) [@actech](https://community.thunkable.com/u/actech)\
**Post date:** [November 6, 2018, 3:30pm UTC](https://community.thunkable.com/t/what-is-use-of-web-api/31258/37 "2018-11-06T15:30:18Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![app007](https://avatars.discourse-cdn.com/v4/letter/a/bcef8e/32.png) [@app007](https://community.thunkable.com/u/app007)\
**Post date:** [November 6, 2018, 3:32pm UTC](https://community.thunkable.com/t/what-is-use-of-web-api/31258/38 "2018-11-06T15:32:56Z")

</div>

[http://community.thunkable.com/t/please-help-unable-to-decode-this-json-code/55190](http://community.thunkable.com/t/please-help-unable-to-decode-this-json-code/55190)

Can u solve the issue…

---

<div class="post-metadata">

**Author:** ![Lin](https://avatars.discourse-cdn.com/v4/letter/l/13edae/32.png) [@Lin](https://community.thunkable.com/u/Lin)\
**Post date:** [November 6, 2018, 3:33pm UTC](https://community.thunkable.com/t/what-is-use-of-web-api/31258/39 "2018-11-06T15:33:31Z")

</div>

[https://x.thunkable.com/copy/7a4cd21cb1b01aa3fad43aaac66e6056](https://x.thunkable.com/copy/7a4cd21cb1b01aa3fad43aaac66e6056)

---

<div class="post-metadata">

**Author:** ![actech](https://avatars.discourse-cdn.com/v4/letter/a/3d9bf3/32.png) [@actech](https://community.thunkable.com/u/actech)\
**Post date:** [November 6, 2018, 3:41pm UTC](https://community.thunkable.com/t/what-is-use-of-web-api/31258/40 "2018-11-06T15:41:48Z")

</div>

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.

[Previous page](https://community.thunkable.com/t/what-is-use-of-web-api/31258.md?page=1)

[Next page](https://community.thunkable.com/t/what-is-use-of-web-api/31258.md?page=3)
