How to send binary file data in API request? Bubble API

Hello all.

I have an api endpoint that only accepts videos in the format of binary data types. Ive tried my calls with postman and it works with the binary file data entry as show. But when I try to integrate this into my project with bubble I don’t know how to send binary files. It only shows json, raw form and raw. Anyone know what I can do to get around this? How can I send a video in binary with this API request?
6

Hi, did you check other threads similar to you to send binary data. There are several posts you can read that match your case. You can also see this thread from zeroqode

and bubble.io binary data site:forum.bubble.io - Google Search

This plugin does not work for video files unfortunately. I need a way to send video files via binary.

1 Like

Hi, did you ever get a solution for this? I’m running into the same issue!

@jacobbseeger This plugin by my dude @GH5T : FileToBinary by GhostCodes Plugin | Bubble

1 Like

It’s not working. Every time I try to use, Bubble runs into a “temporary error.”

@mikepowersofficial did you ever find a solution? Thanks!

@jacobbseeger Have you tried also specifying the Content-Type in the header?

Yes I have! I’m specifying the type “video/mp4”

The way I solved this problem is by using the toolbox plugin and making a custom JavaScript file that sends the information rather than through bubble api. I used chatgpt to make a function that temporarily downloads a video locally and sends it to the api endpoint. It worked like magic. Hope this helps

1 Like

That’s super helpful to know! Thank you @mikepowersofficial . Would you be willing to show the JS code that accomplishes that? That would be a huge help.

If your API endpoint needs authentication like a Bearer token it will be visible to your end users in the browser dev console

I don’t have the code unfortunately I deleted that project lol. But it was for posting videos on YouTube. When you post via api, it gives you a link to upload the binary file. This means you never have to expose your keys just send the binary video request to the endpoint, from the link you got in the first request. I’m not to sure about other platforms though.

1 Like

Hey Mike, would you mind showing how you made your upload call to YouTube using the API connector? Doesn’t have to be the whole OAuth2 process, just the one “video insert” call. I keep running into issues making the call, so seeing how you set it up would be a tremendous help if possible. I’m looking to integrate YouTube posting into my app now that I got binary API calls working!

1 Like

What API are you trying to integrate into?