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!