Passing a Binary File Body Through Xano External API
![Michael Cafra](https://us.v-cdn.net/6037124/uploads/userpics/77HUPSI88RA8/n4XJV5YKVQSZ5.png)
Hi All,
I am attempting to upload a CSV to external service using an API (storage.googleapis.com).
My process involves creating a CSV file from a data source and sending it through the API via a PUT request.
I have the first part of the process which creates a CSV file working.
I also have the second part of the process responsible for the PUT call working in Postman.
Running the the first part, manually downloading the CSV, and passing through the CSV Postman gives me my desired outcome.
I have to merge the second part of the process from Postman into Xano and I am struggling converting the binary body into a suitable parameter inside of Xano.
Any ideas on how I can structure my parameters to handle the CSV file. I have tried a few different options but have failed to get that sweet 200.
Any assistance will be greatly appreciated.
Thanks.
Best Answer
-
Hi @Michael Cafra it sounds like you want multipart here, the way to accomplish that is by using a file resource data type. There's more info within the documentation -- https://docs.xano.com/working-with-data/functions/external-api-request#multipart-support
Answers
-
Hey Michael,
I was able to crack the code with your assistance. I was close but finally found the solution that worked was passing the file resource by itself exclusive of its key-value pair parameter.
Thanks for your support.
-
Great! Yeah - each API can be different so it's good to read the provider's docs to see how they require a parameter to be sent
-
Hi, I have the exact use case and I would need this feature too.
We need to pass the binary body into the body, which works in Postman but not in Xano.
In the meantime, we used Make to achieve the upload part, but it's frustrating to use and pay for another tool just for a workflow action.
-
Hi @vnihoul77 - did you try the method that worked above for the other member?
-
Did anyone manage to find a workaround for this?
Categories
- All Categories
- 53 ? Announcements
- 47 ? Releases
- 37 ? Welcome
- 983 ? Help! I'm a Noob
- 125 ? No-Code Front-Ends
- 633 ? Working with APIs
- 439 ? Transforming data
- 126 ? Connect Xano to ...
- 50 ?? Find an Expert
- 348 ❓Other questions
- 35 ? Security
- 22 ✂️ Snippets
- 19 ? Showcase
- 7 ?️ Xano Chatter
- 62 ? Video Tutorials
- 171 ? Request a feature
- 229 ? Report a Bug
- 19 ? Templates & Extensions
- 7 ? Feedback