# Help with POST API

**URL:** <https://community.thunkable.com/t/help-with-post-api/2966362>\
**Category:** Questions about Thunkable X\
**Tags:** beginner, webapi\
**Created:** [April 24, 2024, 10:35am UTC](https://community.thunkable.com/t/help-with-post-api/2966362 "2024-04-24T10:35:14Z")\
**Posts on this page:** 5\
**Page:** 1

<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 24, 2024, 10:35am UTC](https://community.thunkable.com/t/help-with-post-api/2966362/1 "2024-04-24T10:35:14Z")

</div>

Hi. I’m hoping someone can help me as I’m tearing my hair out trying to get an API to work!

The base URL is [timeapi.io](http://timeapi.io) and the request I’m trying to post is below:

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

These are my blocks, with the request body added as a string (I’ve also tried loads of other ways of adding the CURL parameters) but all I keep getting back is an ‘Unsupported Media’ error.

Can anyone tell me where I’m going wrong?

 ![1](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/1/8/186d2e14084c86c4b19872dfbaa760051c4b95dc.png)

---

<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 24, 2024, 10:43am UTC](https://community.thunkable.com/t/help-with-post-api/2966362/2 "2024-04-24T10:43:40Z")

</div>

Here’s a better example of what I’m trying to do!

 ![3](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/5/8/588bc1b8da7d16e4c6e781144abcaea3ded887bf.png)

The error code is 415 (Unsupported Media Type).

---

<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 24, 2024, 4:00pm UTC](https://community.thunkable.com/t/help-with-post-api/2966362/3 "2024-04-24T16:00:54Z")

</div>

The example has an empty string for dstAmbuiguity. You haven’t given that property a value. Try adding an empty string (“”).

If that still doesn’t work, assign the WebAP1’s Body to a text input’s text and copy what gets displayed. Does it exactly match the sample request above?

Are you checking the value of the green `error` block? I assume that’s how you saw the 415 error message.

---

<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 24, 2024, 4:45pm UTC](https://community.thunkable.com/t/help-with-post-api/2966362/4 "2024-04-24T16:45:16Z")

</div>

Hi - yes, that’s how I picked up the error.

So, I’ve added an empty text string to the dstAmbiguity field as suggested. All that returned was [object Object] but when I added ‘generate JSON from object’ as shown below, it returns the correct result from the API. You, sir, are a star. I’ve been struggling with this for the last couple of days.

 ![4](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/b/1/b1d1ccb284403e0a0f33ff42ab2eb9936cae4a2e.png)

---

<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 23, 2024, 4:46pm UTC](https://community.thunkable.com/t/help-with-post-api/2966362/5 "2024-07-23T16:46:16Z")

</div>

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