# OpenAI API response is valid but not displaying (GPT-4, JSON parsing issue?)

**URL:** https://community.thunkable.com/t/openai-api-response-is-valid-but-not-displaying-gpt-4-json-parsing-issue/3761208
**Category:** Web API's
**Created:** [April 22, 2025, 12:20pm UTC](https://community.thunkable.com/t/openai-api-response-is-valid-but-not-displaying-gpt-4-json-parsing-issue/3761208 "2025-04-22T12:20:31Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![sos3icx43](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/sos3icx43/32/201303_2.png) [@sos3icx43](https://community.thunkable.com/u/sos3icx43)
#### Post date: [April 22, 2025, 12:20pm UTC](https://community.thunkable.com/t/openai-api-response-is-valid-but-not-displaying-gpt-4-json-parsing-issue/3761208/1 "2025-04-22T12:20:31Z")

</div>

Hi everyone,

I’m quite new to Thunkable, and I’m currently building an app that connects to OpenAI’s GPT-4 API using the Web API component.

* * *

Here’s what’s working:

- The API call is properly configured(headers include Content-Type: application/json and Authorization)
- The PromptBody JSON is well-structured and uses “model”: “gpt-4” with “messages”
- The response status is 200 OK
- The returned response is a valid JSON, tested and confirmed using tools like JSON Formatter & Validator

* * *

Here’s the problem:

The response doesn’t show up in the app — nothing is displayed, even when trying:

- To extract the message using:get property of object → choices → 0 → message → content
- To display it in a Label, TextInput, or WebViewer
- To parse the JSON first using GetObjectFromJSON, then accessing properties

We tried with both GPT-3.5 and GPT-4, and the issue is exactly the same:

The response is null or empty — even though we know it’s coming in properly.

* * *

Important notes:

- This is not an issue with Android vs iOS
- This is not an issue with OpenAI Services (we’re using direct API call via Web API block)
- We believe this is a limitation in how Thunkable handles and parses nested JSON returned by the API

* * *

My question:

As someone still learning the platform:

Has anyone successfully extracted and displayed choices[0].message.content from OpenAI’s response using Thunkable?

Or is there a known workaround to parse and render this kind of nested response correctly?

Thanks in advance for your help!

 ![Screenshot 2025-04-22 at 14.17.24](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/4/c/4cced8157424742cbea04c391f409f40b41ed249.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: [April 22, 2025, 2:29pm UTC](https://community.thunkable.com/t/openai-api-response-is-valid-but-not-displaying-gpt-4-json-parsing-issue/3761208/2 "2025-04-22T14:29:20Z")

</div>

JSON arrays start at index 0 but Thunkable lists start at index 1. So you need to get the first item of the “choices” array. That would be “choices[1].message”. By the way, you can simply use that for the property name and avoid using list blocks. Be careful about the double list blocks (`in list [list[get property of object] get #]`). You only need that if the result of the first item is also a list.

If you post the full JSON response as text here and format it using the \</\> in the forums toolbar above the post, I can give you more specific instructions for the property name.
