Unsupported Media Type on an external API call

Options

Hi 🖐️,

I'm having troubles with an external API call. I'm trying to pass an object to a third party API (Eledo, a pdf generating tool) that expects an object and returns a PDF (doc here).
For the loom video of the issue, please check here.

I'm getting an unsupported Media Type error in the Xano debugger.

I digged everything I could on the matter but I can't find a solution on both these questions:

First (sub)question:

Do you necessarily have to set every field of the object in the params field of the call ? It seems that passing the entire object doesn't work. I don't have any curL command and the import JSON action asks that I declare every input. Are these the only options ?

Second question:

I tried to look at this topic to pass a custom header with the expected Eledo response type but I don't manage to make it work and the documentation on this action is pretty thin.

Am I digging in the right direction ?

Thanks a lot for your help 😀

Answers

  • arturosanz
    arturosanz Member ✭✭
    edited October 2023
    Options

    @Maxence Pautre I haven't had time to check on your issue yet, but I have a couple of suggestions.

    1. Whenever you make a video make sure to hide any API-KEY before publishing it. Your key 16knt… is now available to anyone, and this could be dangerous. You should revoke it asap. Also, keep always in mind that any key stored in weweb (frontend) can be easily extracted by an experienced programmer.
    2. I suggest you to test eledo with postman first. Once you are sure it works well from postman, then I would try to connect weweb/xano to eledo. As I said, I haven't had time to check on your issue, but it's a good idea to make sure your problem is not on the eledo side first.

  • Maxence Pautre
    Options

    Hi Arturo and thank you for your answer.

    To comment and it:

    1. Yep you're right, I deleted the video and I'll do another one without any API key details.
    2. By the end of the video, I mentionned that I was using custom Javascript in Weweb with the call to the Eeledo API via Axios and it worked fine. The point of using Xano and not Weweb for this call is precisely to hide any API key in the frontend :)

    I'm gonna do another video withtout any API key details so you or someone else car maybe help ;)

    Thanks again