Passing multipart/form-data to API

Hi, I am new to Feathery and am currently trying to connect my Feathery account to my CRM API.

I am hitting a compatibility roadblock I cannot sort out.

My CRM API requires to first generate an API key passing a client_id and client_secret and then responds with a toke for future requests.

According to the CRM API documentation I need pass the client ID and secret with the body formatted as ‘multipart/form-data’. However, Feathery only allows API integrations to be passed in JSON format from the API connector and if I try so I am getting a 400 Bad Request response.

Using a logic rule works to retrieve API keys but these end up exposed and hence would be a security breach.

Is there any way to pass data through the API connector as multipart/form-data, or as raw data? Otherwise, would there be a way to avoid the returned API key to be exposed when using a logic rule and storing it directly in a hidden field (this sounds more unlikely).

Thank you.

If you pass in Content-Type: multipart/form-data as a header in your API connector, it should send the query in that format

I tried that already, but it does not seem to work. Below you can find screenshots of the API connector setup and response payload:

We made a change since you made the post that added support for that

Thanks Peter. I am still getting an error though. I contacted the API developers also to see if they can provide some help, but it seems that the API is still expecting the data in a different format.

Here are two tests I ran on the different way that the body gets formatted for ‘multipart/form-data’ content:

This is the request to the API that returns the error, and how the API connector is sending the content:

This seems to be how the API is expecting the data and would have been a successful request. (Sent this via postman, where it encodes form values in a structured manner):

Any way that I can pass the data like in the second request?

Thanks - this is helpful. We should have a change out in half an hour or so that should update the way multipart/form-data is passed on our side

Great Peter, thank you for the quick response. Please let me know when this is implemented and I will run some tests.

it is already out now

I ran a new test and this is what is shown:

It seems that it is passing the same minus the “filename=” part, but not actually parsing it as form values. Could it be related to the fact that on the header it is not passing the boundary to identify each part?

Not sure if this is a flaw on the API itself that cannot parse this request body and extract the values of “client_id” and “client_secret” from it. Just in case, this is the API endpoint I am trying to pass the data to:

Can you try again in 20 minutes?

This seems to be almost there but there is a minor issue with the encoding of the values.

The encoding seems to be passing the quotes of the values from the JSON body. So the API is rejecting the values because instead of parsing 7021 as a client idea it is parsing “7021”

Screenshot 2024-06-21 at 16.51.30

Ok please try again in half an hour

Thank you Peter, it seems to be working properly now. Thanks a lot for the quick response.

I am now trying to figure out how to best store the auth token in a secure way. If you can guide me on this ticket I would be very grateful: