Forum Discussion

SheryBulos's avatar
5 years ago

Third Party API - Post request with files uploaded

Hello Everyone 🙂

what is the possible methods to call third party API by  from Khoros ? taking into consideration that it is post request with files attached "formData".

Thanks in advance,
Shery

  • Hi SheryBulos 

    I heard back from our Engineering team.

    While you can create a form and send the non-file form data to an API via http.client.request, we don't currently support passing files using http.client.request. If a customization needs to send files to an API, you'll either need to make the API call from the browser (i.e., an AJAX request) or else you will need to work with Professional Services.

  • SuzieH's avatar
    SuzieH
    Khoros Alumni (Retired)

    Hi SheryBulos 

    I heard back from our Engineering team.

    While you can create a form and send the non-file form data to an API via http.client.request, we don't currently support passing files using http.client.request. If a customization needs to send files to an API, you'll either need to make the API call from the browser (i.e., an AJAX request) or else you will need to work with Professional Services.

    • Hello RyanPi ,

      Thanks for your help but this guide handles creating an integration with a third-party API however this doesn't have an example for form data api (having file attached) and passing it as a parameter to the API.

      I need to make a post request with form data (passing file).


      • SuzieH's avatar
        SuzieH
        Khoros Alumni (Retired)

        Hi SheryBulos
        I'm reaching out to our Services and Engineering teams to see if we support this and if so, the example format.