# API object of objects problem

**URL:** <https://community.thunkable.com/t/api-object-of-objects-problem/1195654>\
**Category:** Questions about Thunkable X\
**Tags:** beginner, webapi, problems\
**Created:** [March 30, 2021, 10:09am UTC](https://community.thunkable.com/t/api-object-of-objects-problem/1195654 "2021-03-30T10:09:37Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![galatioto1un7](https://avatars.discourse-cdn.com/v4/letter/g/4bbf92/32.png) [@galatioto1un7](https://community.thunkable.com/u/galatioto1un7)\
**Post date:** [March 30, 2021, 10:09am UTC](https://community.thunkable.com/t/api-object-of-objects-problem/1195654/1 "2021-03-30T10:09:37Z")

</div>

Hi  
I’m testing Thunkable platform with a free API service, so I’m trying to receive data from this: [https://www.thecocktaildb.com/api/json/v1/1/search.php?s=margarita](https://www.thecocktaildb.com/api/json/v1/1/search.php?s=margarita)  
I’ve configured API block and I get response object but the problem in that I have a “object of objects” so I need first to access at one property (and it works…) and then to then second one but this doesn’t work .  
If I try to use a second “get properties objects” block it go to white page, on the contrary I obtain status 200 and only text like “object, object, object”.  
I think the problem is that I get a JSON object…of objects but how to parse and list it?

---

<div class="post-metadata">

**Author:** ![muneer](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/muneer/32/75210_2.png) [@muneer](https://community.thunkable.com/u/muneer)\
**Post date:** [March 30, 2021, 10:27am UTC](https://community.thunkable.com/t/api-object-of-objects-problem/1195654/2 "2021-03-30T10:27:57Z")

</div>

You will need to show your code and a copy of the response. API formats are all different and without seeing the response you are getting it would very difficult to answer.

---

<div class="post-metadata">

**Author:** ![galatioto1un7](https://avatars.discourse-cdn.com/v4/letter/g/4bbf92/32.png) [@galatioto1un7](https://community.thunkable.com/u/galatioto1un7)\
**Post date:** [March 30, 2021, 10:46am UTC](https://community.thunkable.com/t/api-object-of-objects-problem/1195654/3 "2021-03-30T10:46:19Z")

</div>

![Screenshot from 2021-03-30 12-44-04](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/5/4/542fb8831b316083c28fbdd04085ebe5d23162cf.png) ![Screenshot from 2021-03-30 12-44-50](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/d/c/dc78f329e52bff1a00843af64f5c7bab00ed87b8.png)

---

<div class="post-metadata">

**Author:** ![galatioto1un7](https://avatars.discourse-cdn.com/v4/letter/g/4bbf92/32.png) [@galatioto1un7](https://community.thunkable.com/u/galatioto1un7)\
**Post date:** [March 30, 2021, 10:47am UTC](https://community.thunkable.com/t/api-object-of-objects-problem/1195654/4 "2021-03-30T10:47:05Z")

</div>

Yes, sorry, I done it below

---

<div class="post-metadata">

**Author:** ![muneer](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/muneer/32/75210_2.png) [@muneer](https://community.thunkable.com/u/muneer)\
**Post date:** [March 30, 2021, 11:04am UTC](https://community.thunkable.com/t/api-object-of-objects-problem/1195654/5 "2021-03-30T11:04:31Z")

</div>

Please show the response you received not the object properties.  
[Set ListaTuttilMargarita’s Test to] [response]

If the response is long than save it to a file and upload it in the post.

I looked at the output of the API URL and you need to watch this tutorial because your response has a list which you are not reflecting in your blocks.

> [@API JSON Tutorial (Video)](https://community.thunkable.com/t/api-json-tutorial-video/1140575):
>
> Using APIs in Thunkable and understanding how to parse JSON to get certain data from the API response is both a popular and a difficult aspect of using Thunkable. It’s not so much difficult because of Thunkable but because every API url format is different, every API documentation is different, every JSON response is different, etc. In this video, I spend a lot of time talking you through some best practices. It’s not a quick tutorial because if you rush through setting up an API in Thunkable, …

---

<div class="post-metadata">

**Author:** ![galatioto1un7](https://avatars.discourse-cdn.com/v4/letter/g/4bbf92/32.png) [@galatioto1un7](https://community.thunkable.com/u/galatioto1un7)\
**Post date:** [March 30, 2021, 11:18am UTC](https://community.thunkable.com/t/api-object-of-objects-problem/1195654/6 "2021-03-30T11:18:35Z")

</div>

Ok, this is the json response.  
[search.txt](https://community.thunkable.com/uploads/short-url/mGCMAwDgG8YO1FFQHFjcipi0U9B.txt) (10.8 KB)

I’ve already tried to “concat” another “Get property of object” with the property “strDrink” and , at the end ofcouse, the “Get object JSON/Response” but it crash…

---

<div class="post-metadata">

**Author:** ![muneer](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/muneer/32/75210_2.png) [@muneer](https://community.thunkable.com/u/muneer)\
**Post date:** [March 30, 2021, 11:29am UTC](https://community.thunkable.com/t/api-object-of-objects-problem/1195654/7 "2021-03-30T11:29:22Z")

</div>

The response shows a key named “drinks” which refers to a list of, I think, 4 items. Each item is also an object with lots of items in it.

So your block has to have a list and choose an item number from the list and a key in the object inside the list, such as “strDrink”.

---

<div class="post-metadata">

**Author:** ![galatioto1un7](https://avatars.discourse-cdn.com/v4/letter/g/4bbf92/32.png) [@galatioto1un7](https://community.thunkable.com/u/galatioto1un7)\
**Post date:** [March 30, 2021, 11:46am UTC](https://community.thunkable.com/t/api-object-of-objects-problem/1195654/8 "2021-03-30T11:46:48Z")

</div>

Thank you @Muneer yes I’ve understood this watching @Tatiang’s video (Thanks!)… 😜  
Thank you all my problem was to understand difference between List and Object access.  
So it is solved! For other people I attach my code block fixed

 ![Screenshot from 2021-03-30 13-40-46](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/5/2/52b30f0b35f1607ce2d8bd3e63bed2719a174b94.png)  
Thank you all

---

<div class="post-metadata">

**Author:** ![ioannis](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/ioannis/32/146956_2.png) [@ioannis](https://community.thunkable.com/u/ioannis)\
**Post date:** [November 8, 2024, 1:25pm UTC](https://community.thunkable.com/t/api-object-of-objects-problem/1195654/9 "2024-11-08T13:25:39Z")

</div>


