Help with POST API

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 and the request I’m trying to post is below:

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?

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

The error code is 415 (Unsupported Media Type).

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.

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.

1 Like