# API keeps saying JSON only, but JSON is being sent

**URL:** <https://community.thunkable.com/t/api-keeps-saying-json-only-but-json-is-being-sent/2976173>\
**Category:** Questions about Thunkable X\
**Created:** [April 29, 2024, 11:58pm UTC](https://community.thunkable.com/t/api-keeps-saying-json-only-but-json-is-being-sent/2976173 "2024-04-29T23:58:26Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![patanellaxq6lk](https://avatars.discourse-cdn.com/v4/letter/p/0ea827/32.png) [@patanellaxq6lk](https://community.thunkable.com/u/patanellaxq6lk)\
**Post date:** [April 29, 2024, 11:58pm UTC](https://community.thunkable.com/t/api-keeps-saying-json-only-but-json-is-being-sent/2976173/1 "2024-04-29T23:58:26Z")

</div>

I am currently running into an issue with my code where I have to send JSON to post an API, but when I send JSON it always says it is receiving text.

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

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

[https://x.thunkable.com/projects/6566796a8f7787bd7ba632fc/1a3e5828-0392-4bf0-8256-2977271336b3/blocks](https://x.thunkable.com/projects/6566796a8f7787bd7ba632fc/1a3e5828-0392-4bf0-8256-2977271336b3/blocks)

---

<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 30, 2024, 12:59am UTC](https://community.thunkable.com/t/api-keeps-saying-json-only-but-json-is-being-sent/2976173/2 "2024-04-30T00:59:29Z")

</div>

You might need to add a content-type header like in the screenshot here: [Cannot set API header for Content-Type](https://community.thunkable.com/t/cannot-set-api-header-for-content-type/2460425)

---

<div class="post-metadata">

**Author:** ![damienc](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/damienc/32/174882_2.png) [@damienc](https://community.thunkable.com/u/damienc)\
**Post date:** [April 30, 2024, 7:36am UTC](https://community.thunkable.com/t/api-keeps-saying-json-only-but-json-is-being-sent/2976173/3 "2024-04-30T07:36:53Z")

</div>

I had a similar issue with another API. The fix was to add ‘Content-Type’ and ‘accept’ headers to the call, with the text of both set to ‘application/json’.

Can you see an example successful call on the API website for example? It’ll show you what the various elements of a successful call are.

---

<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 30, 2024, 2:48pm UTC](https://community.thunkable.com/t/api-keeps-saying-json-only-but-json-is-being-sent/2976173/4 "2024-04-30T14:48:32Z")

</div>

> [@damienc](#):
>
> Can you see an example successful call on the API website for example? It’ll show you what the various elements of a successful call are.

What is the link to that?

---

<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:** [July 29, 2024, 2:48pm UTC](https://community.thunkable.com/t/api-keeps-saying-json-only-but-json-is-being-sent/2976173/5 "2024-07-29T14:48:45Z")

</div>

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