# How can i process the response of a webviewer api

**URL:** <https://community.thunkable.com/t/how-can-i-process-the-response-of-a-webviewer-api/1786263>\
**Category:** Questions about Thunkable X\
**Created:** [March 16, 2022, 3:03am UTC](https://community.thunkable.com/t/how-can-i-process-the-response-of-a-webviewer-api/1786263 "2022-03-16T03:03:53Z")\
**Posts on this page:** 19\
**Page:** 1

<div class="post-metadata">

**Author:** ![manyone](https://avatars.discourse-cdn.com/v4/letter/m/ee59a6/32.png) [@manyone](https://community.thunkable.com/u/manyone)\
**Post date:** [March 16, 2022, 3:03am UTC](https://community.thunkable.com/t/how-can-i-process-the-response-of-a-webviewer-api/1786263/1 "2022-03-16T03:03:53Z")

</div>

i found his api that can give today’s horoscope for any zodiac sign and it works fine from a browser - it returns a json response.

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

and when i use a webviewer in thunkable pointing to the url,  
 ![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/a/8/a893e54624e129d7d3d26ebc92b1a0059af8357c.png)

i also get back a json string  
 ![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/d/a/da60415116fde0f1f1871577565b750dbcebe475.png)

i have 2 questions:

1. is it possible to get the response (hidden ie. not displayed) so i could parse iit a a json string and present the fields nicely in a nice page (and not in a webviewer page)?

2. why do i get a network error when i try to use webapi on it?

![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/3/5/35cecae31305e11ea3ba54fe7b1d74f6d8ab19c8.png)

![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/f/a/faccb7a1cd3b12b3113d3f42239024be58a6eba6.png)

NetworkError when attempting to fetch resource.

here’s the project to play with  
[https://x.thunkable.com/copy/ab71441300a96df382f0caaa0214ded5](https://x.thunkable.com/copy/ab71441300a96df382f0caaa0214ded5)

---

<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:** [March 16, 2022, 3:50am UTC](https://community.thunkable.com/t/how-can-i-process-the-response-of-a-webviewer-api/1786263/2 "2022-03-16T03:50:12Z")

</div>

I did get an error in Thunkable Live but then I pasted the API url in again and it worked. But it’s exactly the same as what you had (I think) so I’m not sure what happened there.

You can parse the JSON response to get the horoscope or other properties. See the first screen of this demo:

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

---

<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 16, 2022, 3:50am UTC](https://community.thunkable.com/t/how-can-i-process-the-response-of-a-webviewer-api/1786263/3 "2022-03-16T03:50:18Z")

</div>

> [@manyone](#):
>
> - is it possible to get the response (hidden ie. not displayed) so i could parse iit a a json string and present the fields nicely in a nice page (and not in a webviewer page)?

Yes, you can but you have to use the `Web Viewer Extension` to pass info back to the app.

> [@manyone](#):
>
> - why do i get a network error when i try to use webapi on it?

This means you need to test it from the mobile not the computer, I think.

**[Update]**

I just tested this block from Thunkable mobile app and it worked.

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

---

<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:** [March 16, 2022, 3:54am UTC](https://community.thunkable.com/t/how-can-i-process-the-response-of-a-webviewer-api/1786263/4 "2022-03-16T03:54:05Z")

</div>

I figured it out. Your API url had a space (" ") at the end. It was causing problems.

 ![Screen Shot 2022-03-15 at 8.54.52 PM](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/c/1/c1a7506ca67c2e2793adf4afa7f5024cee772d9b.png)

---

<div class="post-metadata">

**Author:** ![manyone](https://avatars.discourse-cdn.com/v4/letter/m/ee59a6/32.png) [@manyone](https://community.thunkable.com/u/manyone)\
**Post date:** [March 16, 2022, 3:58am UTC](https://community.thunkable.com/t/how-can-i-process-the-response-of-a-webviewer-api/1786263/5 "2022-03-16T03:58:18Z")

</div>

it still fails for me on the desktop even after i removed the trailing space!

---

<div class="post-metadata">

**Author:** ![manyone](https://avatars.discourse-cdn.com/v4/letter/m/ee59a6/32.png) [@manyone](https://community.thunkable.com/u/manyone)\
**Post date:** [March 16, 2022, 4:00am UTC](https://community.thunkable.com/t/how-can-i-process-the-response-of-a-webviewer-api/1786263/6 "2022-03-16T04:00:11Z")

</div>

it worked for me on my android, too. thanks!  
(so much inconsistency though)

---

<div class="post-metadata">

**Author:** ![manyone](https://avatars.discourse-cdn.com/v4/letter/m/ee59a6/32.png) [@manyone](https://community.thunkable.com/u/manyone)\
**Post date:** [March 16, 2022, 4:14am UTC](https://community.thunkable.com/t/how-can-i-process-the-response-of-a-webviewer-api/1786263/7 "2022-03-16T04:14:54Z")

</div>

this would be hard to test because i would have to flip back and forth betwen desktop and mobile after every change! for an app like this, it’s simple - but beyond this it would be tough!

---

<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 16, 2022, 4:17am UTC](https://community.thunkable.com/t/how-can-i-process-the-response-of-a-webviewer-api/1786263/8 "2022-03-16T04:17:17Z")

</div>

Unfortunately this is a platform limitation.

You can keep The Thunkable app open and showing your project in your mobile while you change the blocks in your computer and the changes will be reflected with a little delay.

---

<div class="post-metadata">

**Author:** ![manyone](https://avatars.discourse-cdn.com/v4/letter/m/ee59a6/32.png) [@manyone](https://community.thunkable.com/u/manyone)\
**Post date:** [March 16, 2022, 4:19am UTC](https://community.thunkable.com/t/how-can-i-process-the-response-of-a-webviewer-api/1786263/9 "2022-03-16T04:19:07Z")

</div>

maybe it’s not so bad. i’ll play with it later. thanks!

---

<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:** [March 16, 2022, 4:30am UTC](https://community.thunkable.com/t/how-can-i-process-the-response-of-a-webviewer-api/1786263/10 "2022-03-16T04:30:54Z")

</div>

Many APIs don’t work in a desktop browser.

But if you test in Thunkable Live, it’s quick to see if you’re parsing it correctly or not.

---

<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:** [March 16, 2022, 11:43am UTC](https://community.thunkable.com/t/how-can-i-process-the-response-of-a-webviewer-api/1786263/11 "2022-03-16T11:43:55Z")

</div>

It’s a strict CORS policy issue I’m guessing. I can’t explain it as I don’t fully understand why it’s happening. It’ll have something to do with the host website/server. I’ll ask the engineers this week if there’s anything we can do to improve that issue.

---

<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 16, 2022, 11:55am UTC](https://community.thunkable.com/t/how-can-i-process-the-response-of-a-webviewer-api/1786263/12 "2022-03-16T11:55:43Z")

</div>

I will, later, create an HTML file to read the data and pass it to the `Web Viewer` which should solve the issue of not being able to run it from your computer.

---

<div class="post-metadata">

**Author:** ![manyone](https://avatars.discourse-cdn.com/v4/letter/m/ee59a6/32.png) [@manyone](https://community.thunkable.com/u/manyone)\
**Post date:** [March 16, 2022, 10:45pm UTC](https://community.thunkable.com/t/how-can-i-process-the-response-of-a-webviewer-api/1786263/13 "2022-03-16T22:45:13Z")

</div>

i got my horoscope app working - thanks to everyone’s suggestions!  
here’s the project link (remember, you can only live test on the device!)

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

 ![Screenshot_20220316-154800_Thunkable](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/f/4/f406c39179f2f628d817e4ca34f556e7daff9051.jpeg)

is there a command to terminate the application? (like a button to say ‘done’)

---

<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:** [March 17, 2022, 1:29am UTC](https://community.thunkable.com/t/how-can-i-process-the-response-of-a-webviewer-api/1786263/14 "2022-03-17T01:29:05Z")

</div>

> [@manyone](#):
>
> is there a command to terminate the application? (like a button to say ‘done’)

No button or blocks to “close” apps.

This is super cool! Thanks for sharing!!

---

<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 17, 2022, 10:28am UTC](https://community.thunkable.com/t/how-can-i-process-the-response-of-a-webviewer-api/1786263/15 "2022-03-17T10:28:25Z")

</div>

> [@jared](#):
>
> I’ll ask the engineers this week if there’s anything we can do to improve that issue.

This is the actual issue for all API calls from Thunkable computer preview.

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

It seems Thunkable preview server blocks information including the server name. Most API service sites would not accept **null** as a source of request as it could be a hacking attempt.

---

<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:** [March 17, 2022, 11:09am UTC](https://community.thunkable.com/t/how-can-i-process-the-response-of-a-webviewer-api/1786263/16 "2022-03-17T11:09:30Z")

</div>

The same isn’t happening from published webapps is it? I think this is just an issue related to preview online?

---

<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 17, 2022, 11:18am UTC](https://community.thunkable.com/t/how-can-i-process-the-response-of-a-webviewer-api/1786263/17 "2022-03-17T11:18:45Z")

</div>

> [@jared](#):
>
> The same isn’t happening from published webapps is it?

Have you tried it?

It didn’t work for me as a web app, either.

---

<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:** [March 17, 2022, 11:51am UTC](https://community.thunkable.com/t/how-can-i-process-the-response-of-a-webviewer-api/1786263/18 "2022-03-17T11:51:09Z")

</div>

Thanks for turnip it here @muneer I’ll check it out today and file a bug report if it makes sense. That’s an issue if it’s happening for webapps.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/0/f/0f59f292712368bce16ff80133ae10de8a6f27e8.png) [@system](https://community.thunkable.com/u/system)\
**Post date:** [June 15, 2022, 11:51am UTC](https://community.thunkable.com/t/how-can-i-process-the-response-of-a-webviewer-api/1786263/19 "2022-06-15T11:51:51Z")

</div>

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.
