# Unable to parse Web API response

**URL:** <https://community.thunkable.com/t/unable-to-parse-web-api-response/1674371>\
**Category:** Questions about Thunkable X\
**Created:** [January 16, 2022, 9:28am UTC](https://community.thunkable.com/t/unable-to-parse-web-api-response/1674371 "2022-01-16T09:28:06Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![bibbi](https://avatars.discourse-cdn.com/v4/letter/b/db5fbb/32.png) [@bibbi](https://community.thunkable.com/u/bibbi)\
**Post date:** [January 16, 2022, 9:28am UTC](https://community.thunkable.com/t/unable-to-parse-web-api-response/1674371/1 "2022-01-16T09:28:06Z")

</div>

hi

with this api I retrieve connection identifiers in web preview mode it works in live test it does not work in the application but in a simplified screen yes  
and it worked before I feel like I’m wasting time for nothing…  
in this first screen there is only the display of label and textboxes and using this web api call

---

<div class="post-metadata">

**Author:** ![tatiang](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/tatiang/32/55482_2.png) [@tatiang](https://community.thunkable.com/u/tatiang)\
**Post date:** [January 16, 2022, 9:33am UTC](https://community.thunkable.com/t/unable-to-parse-web-api-response/1674371/2 "2022-01-16T09:33:28Z")

</div>

If you don’t provide details then we can’t help you.

---

<div class="post-metadata">

**Author:** ![bibbi](https://avatars.discourse-cdn.com/v4/letter/b/db5fbb/32.png) [@bibbi](https://community.thunkable.com/u/bibbi)\
**Post date:** [January 16, 2022, 10:19am UTC](https://community.thunkable.com/t/unable-to-parse-web-api-response/1674371/3 "2022-01-16T10:19:10Z")

</div>

hi

thanks for your support

I wonder if it’s the blocks that are to blame.

 ![Capture d’écran 2022-01-16 à 11.15.34](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/7/7/7749ce746306637059bffb30fb1715c312964f18.png)

these blocks work in a simplified app and in web preview mode

update

on another phone it works (ios) but the data changed block no

---

<div class="post-metadata">

**Author:** ![tatiang](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/tatiang/32/55482_2.png) [@tatiang](https://community.thunkable.com/u/tatiang)\
**Post date:** [January 16, 2022, 5:34pm UTC](https://community.thunkable.com/t/unable-to-parse-web-api-response/1674371/4 "2022-01-16T17:34:53Z")

</div>

What is the value of the green `error` block when it doesn’t work?

Do the blocks in your screenshot work:

1. In web preview?
2. Live tested in iOS?
3. Live tested in Android?
4. Downloaded to iOS?
5. Downloaded to Android?

What does this mean?

> [@bibbi](#):
>
> but the data changed block no

---

<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:** [January 16, 2022, 5:39pm UTC](https://community.thunkable.com/t/unable-to-parse-web-api-response/1674371/5 "2022-01-16T17:39:57Z")

</div>

> [@tatiang](#):
>
> What is the value of the green `error` block when it doesn’t work?

I believe he is using his own Google Apps Script and the issue could also be from that side not only from the app side.

Such issues are very difficult to resolve.

One thing I noticed in the code that the `status` is compared by `200` as a number but most API will return it as text. However, due to the fact that this API URL is self developed (I assumed) it will be difficult to say what it should be.

---

<div class="post-metadata">

**Author:** ![tatiang](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/tatiang/32/55482_2.png) [@tatiang](https://community.thunkable.com/u/tatiang)\
**Post date:** [January 16, 2022, 5:42pm UTC](https://community.thunkable.com/t/unable-to-parse-web-api-response/1674371/6 "2022-01-16T17:42:12Z")

</div>

Yes, I wouldn’t normally check for status=200. I would just see if there’s an error and if not, then get the response.

I agree that Google Script debugging can be difficult.

---

<div class="post-metadata">

**Author:** ![bibbi](https://avatars.discourse-cdn.com/v4/letter/b/db5fbb/32.png) [@bibbi](https://community.thunkable.com/u/bibbi)\
**Post date:** [January 16, 2022, 7:33pm UTC](https://community.thunkable.com/t/unable-to-parse-web-api-response/1674371/7 "2022-01-16T19:33:52Z")

</div>

hi

it’s good to have support  
if i can allow myself in summary this web api call works under ios (live test), web preview on android (live test) in a reduction of my application but not in my application  
this script you are concerned about will just fetch data from a spreadsheet and i use it in another application  
I must have done something that blocks the web api

but there is a big downside is that it only works on IOs if the firebase rules are on true but that’s the subject of another post

---

<div class="post-metadata">

**Author:** ![bibbi](https://avatars.discourse-cdn.com/v4/letter/b/db5fbb/32.png) [@bibbi](https://community.thunkable.com/u/bibbi)\
**Post date:** [January 16, 2022, 7:35pm UTC](https://community.thunkable.com/t/unable-to-parse-web-api-response/1674371/8 "2022-01-16T19:35:10Z")

</div>

it’s good to have support

if i can allow myself in summary this web api call works under ios (live test), web preview on android (live test) in a reduction of my application but not in my application  
this script you are concerned about will just fetch data from a spreadsheet and i use it in another application  
I must have done something that blocks the web api

but there is a big downside is that it only works on IOs if the firebase rules are on true but that’s the subject of another post

---

<div class="post-metadata">

**Author:** ![jared](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/jared/32/138473_2.png) [@jared](https://community.thunkable.com/u/jared)\
**Post date:** [January 16, 2022, 9:31pm UTC](https://community.thunkable.com/t/unable-to-parse-web-api-response/1674371/9 "2022-01-16T21:31:20Z")

</div>

> [@bibbi](#):
>
> but there is a big downside is that it only works on IOs if the firebase rules are on true but that’s the subject of another post

can you please provide a minimal example that shows this discrepancy?

Does your app script require you to be logged in to execute?

---

<div class="post-metadata">

**Author:** ![bibbi](https://avatars.discourse-cdn.com/v4/letter/b/db5fbb/32.png) [@bibbi](https://community.thunkable.com/u/bibbi)\
**Post date:** [January 17, 2022, 3:19am UTC](https://community.thunkable.com/t/unable-to-parse-web-api-response/1674371/10 "2022-01-17T03:19:44Z")

</div>

hi

> can you please provide a minimal example that shows this discrepancy?Blockquote

i have already done it on my side a single screen and the call of the script the result stored in a label it works on android and on IOS and in preview mode  
no to call this script I don’t need to be logged

---

<div class="post-metadata">

**Author:** ![jared](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/jared/32/138473_2.png) [@jared](https://community.thunkable.com/u/jared)\
**Post date:** [January 17, 2022, 4:07am UTC](https://community.thunkable.com/t/unable-to-parse-web-api-response/1674371/11 "2022-01-17T04:07:50Z")

</div>

> [@bibbi](#):
>
> preview mode  
> no to

Using the web preview? Or it doesn’t work when you use the companion app? Again, can you please provide a minimal example that shows this discrepancy? If I can reproduce the issue on my end I can file a useful bug report if there’s a bug to report!

---

<div class="post-metadata">

**Author:** ![bibbi](https://avatars.discourse-cdn.com/v4/letter/b/db5fbb/32.png) [@bibbi](https://community.thunkable.com/u/bibbi)\
**Post date:** [January 17, 2022, 11:19am UTC](https://community.thunkable.com/t/unable-to-parse-web-api-response/1674371/12 "2022-01-17T11:19:00Z")

</div>

Hi

I will provide you an example.

but I must admit that the recurring problem is related to firebase rules I thought it was enough to authenticate but that’s not the case when I think it works with android it’s because I use my account as muneer would say and when does it actually work with android, it doesn’t work with ios with the same rules enough to be discouraged

---

<div class="post-metadata">

**Author:** ![bibbi](https://avatars.discourse-cdn.com/v4/letter/b/db5fbb/32.png) [@bibbi](https://community.thunkable.com/u/bibbi)\
**Post date:** [January 17, 2022, 7:26pm UTC](https://community.thunkable.com/t/unable-to-parse-web-api-response/1674371/13 "2022-01-17T19:26:48Z")

</div>

how i send you ?

---

<div class="post-metadata">

**Author:** ![jared](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/jared/32/138473_2.png) [@jared](https://community.thunkable.com/u/jared)\
**Post date:** [January 17, 2022, 8:34pm UTC](https://community.thunkable.com/t/unable-to-parse-web-api-response/1674371/14 "2022-01-17T20:34:04Z")

</div>

If you create project, you can share it here or send it in a DM. If it’s a minimal example, it should be fine to share here in the form as a ‘copy’

---

<div class="post-metadata">

**Author:** ![bibbi](https://avatars.discourse-cdn.com/v4/letter/b/db5fbb/32.png) [@bibbi](https://community.thunkable.com/u/bibbi)\
**Post date:** [January 17, 2022, 8:51pm UTC](https://community.thunkable.com/t/unable-to-parse-web-api-response/1674371/15 "2022-01-17T20:51:46Z")

</div>

> [@Unable to parse Web API response](https://community.thunkable.com/t/web-api-issue-or-thunkable-fantasies/1674371/14):
>
> If you create project, you can share it here or send it in a DM. If it’s a minimal example, it should be fine to share here in the form as a ‘copy’

here is the link

[https://x.thunkable.com/copy/3640773dee4296dbdf50ef7f2aca46f6](https://x.thunkable.com/copy/3640773dee4296dbdf50ef7f2aca46f6)

the same api call above doesn’t work in android

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

---

<div class="post-metadata">

**Author:** ![tatiang](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/tatiang/32/55482_2.png) [@tatiang](https://community.thunkable.com/u/tatiang)\
**Post date:** [January 17, 2022, 9:40pm UTC](https://community.thunkable.com/t/unable-to-parse-web-api-response/1674371/16 "2022-01-17T21:40:07Z")

</div>

@bibbi It would be helpful if you could provide a yes or no answer for each of these:

> [@tatiang](#):
>
> Do the blocks in your screenshot work:
> 
> 1. In web preview?
> 2. Live tested in iOS?
> 3. Live tested in Android?
> 4. Downloaded to iOS?
> 5. Downloaded to Android?

When I try it, these are my results:

1. Yes
2. Yes
3. Yes
4. (Haven’t tried, will update…)
5. (Android download servers are not working…)

In each case, I see this:

 ![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/d/e/deafa2f28a94bc1f049ca742d670f52bcdc6b3d0.png)

---

<div class="post-metadata">

**Author:** ![bibbi](https://avatars.discourse-cdn.com/v4/letter/b/db5fbb/32.png) [@bibbi](https://community.thunkable.com/u/bibbi)\
**Post date:** [January 17, 2022, 9:48pm UTC](https://community.thunkable.com/t/unable-to-parse-web-api-response/1674371/17 "2022-01-17T21:48:08Z")

</div>

hi

the first link :

1. Yes
2. Yes
3. Yes

the second link :

1. Yes  
2.Yes
2. No

---

<div class="post-metadata">

**Author:** ![tatiang](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/tatiang/32/55482_2.png) [@tatiang](https://community.thunkable.com/u/tatiang)\
**Post date:** [January 17, 2022, 9:48pm UTC](https://community.thunkable.com/t/unable-to-parse-web-api-response/1674371/18 "2022-01-17T21:48:31Z")

</div>

“employees” is a list… why are you getting the object properties of that list? I see lots of problems with the way you are parsing the JSON response:

 ![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/b/7/b7c007371442ba73345f02bd62d271fc35565beb.png)

You don’t need the extra `get object properties of` block at the top of the loop. And since you’re getting list items and storing them in `j`, you can just use j… you don’t need to get the properties of “employees” over and over again. That’s already included in `j`.

Try this instead:

 ![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/2/0/2007320e339ef84ea33c4d4dc01589e6f5b639ad.png)

Here’s a modified project that generates a list of the “email” property values from the API:

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

And the result when Live Tested on Android looks like this preview:

![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/4/8/488d4014c51dd1e73400604f7a3e3e3b1f6c06df.png)

---

<div class="post-metadata">

**Author:** ![bibbi](https://avatars.discourse-cdn.com/v4/letter/b/db5fbb/32.png) [@bibbi](https://community.thunkable.com/u/bibbi)\
**Post date:** [January 17, 2022, 10:13pm UTC](https://community.thunkable.com/t/unable-to-parse-web-api-response/1674371/19 "2022-01-17T22:13:49Z")

</div>

thank you for this decisive support however if on my android your proposal indeed works my application extract which your observations do not work

---

<div class="post-metadata">

**Author:** ![tatiang](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/tatiang/32/55482_2.png) [@tatiang](https://community.thunkable.com/u/tatiang)\
**Post date:** [January 17, 2022, 11:37pm UTC](https://community.thunkable.com/t/unable-to-parse-web-api-response/1674371/20 "2022-01-17T23:37:06Z")

</div>

I’m sorry, I don’t understand what you wrote. What is not working?

You can use the yes/no for #1-5 as I suggested above.

[Next page](https://community.thunkable.com/t/unable-to-parse-web-api-response/1674371.md?page=2)
