# API response body - How to use that in Thunkable?

**URL:** <https://community.thunkable.com/t/api-response-body-how-to-use-that-in-thunkable/1936331>\
**Category:** Web API's\
**Tags:** beginner\
**Created:** [June 22, 2022, 6:53pm UTC](https://community.thunkable.com/t/api-response-body-how-to-use-that-in-thunkable/1936331 "2022-06-22T18:53:56Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![manu.commerce6qnp](https://avatars.discourse-cdn.com/v4/letter/m/eb8c5e/32.png) [@manu.commerce6qnp](https://community.thunkable.com/u/manu.commerce6qnp)\
**Post date:** [June 22, 2022, 6:53pm UTC](https://community.thunkable.com/t/api-response-body-how-to-use-that-in-thunkable/1936331/1 "2022-06-22T18:53:56Z")

</div>

I have an API on AWS API Gateway which i can call successfully on browsers. It returns encoded binary content in the response body (audio/mpeg) - mp3 file. On browser it successfully plays. I am trying to get it playing either by video player or by using sound component. Both dont work.

On Thunkable it is giving an error: network error when attempting to fetch resource. I believe this is a CORS error.

If i try live testing on mobile device, first it gives 500 server error, then the video window appears for a micro second and then goes away. Nothing plays.

 ![Screen Shot 2022-06-23 at 12.22.48 AM](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/5/b/5b09ba6ed5a0d8b5716ed57285ef24038f5671cd.png)

Any way i can make it work?

---

<div class="post-metadata">

**Author:** ![zander](https://avatars.discourse-cdn.com/v4/letter/z/ecb155/32.png) [@zander](https://community.thunkable.com/u/zander)\
**Post date:** [June 23, 2022, 1:03am UTC](https://community.thunkable.com/t/api-response-body-how-to-use-that-in-thunkable/1936331/3 "2022-06-23T01:03:24Z")

</div>

Have you set the api url/body/header?

---

<div class="post-metadata">

**Author:** ![manu.commerce6qnp](https://avatars.discourse-cdn.com/v4/letter/m/eb8c5e/32.png) [@manu.commerce6qnp](https://community.thunkable.com/u/manu.commerce6qnp)\
**Post date:** [June 27, 2022, 5:44am UTC](https://community.thunkable.com/t/api-response-body-how-to-use-that-in-thunkable/1936331/4 "2022-06-27T05:44:26Z")

</div>

Yes I have set the API url, header . Body is not required for the API. API as such works in browser, postman etc.

---

<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:** [June 27, 2022, 9:19am UTC](https://community.thunkable.com/t/api-response-body-how-to-use-that-in-thunkable/1936331/5 "2022-06-27T09:19:07Z")

</div>

have you tried using get\_object\_from\_json block on the green response first before playing it?

if that still fails, have you tried using a CORS proxy? search our forums for “CORS proxy” and locate allorigins. or you can go to this directly:

> [@\[Solved\] Project won't GET data from API in Web Preview \[CORS issue\]](https://community.thunkable.com/t/project-wont-get-data-from-api-in-web-preview-cors-issue/1888743/5):
>
> i found a way to get around “cannot GET” errors in webapi (due to CORS - cross origin issue). the answer is [allOrigins](https://allorigins.win/) whose catch phrase is " Pull contents from any page via API (as JSON/P or raw) and avoid Same-origin policy problems." the original problem started because of this behavior: the link below works in a browser and also works in Postman but does NOT work in Thunkable (due to CORS issues apparently) http://numbersapi.com/2000/year?json this is the result from a browser:

---

<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:13pm UTC](https://community.thunkable.com/t/api-response-body-how-to-use-that-in-thunkable/1936331/6 "2024-11-08T13:13:07Z")

</div>


