Forum Academy Marketplace Showcase Pricing Features

Send private file through API connector


I would like to send private files through the API connector.
With the right privacy role set-up, these files should be sent “in clear” to the API connector, shouldn’t they ? .

But it’s not working : Bubble support says it’s not a bug it’s just a feature that is not supported !

So I’m looking at workarounds to be able to store files in a private and secured manner while being able to send them through the API.

The DropBox plugin doesn’t seem to be downloading correctly files from DropBox according to the documentation : I would be able to upload the files in DropBox, but not to retrieve them from DropBox to forward them to the API connector.

I was thinking about making the file “public” just for a couple of seconds while sending it to the API. I’ve found a way to convert a public file into a private file. But there don’t seem to be any ways to convert a private file into a public file.

I haven’t found any ways to copy or duplicate files in S3 either - that might have been another path to explore.

Any ideas or suggestions ? That would be a great help.

Thank you

If you store a file as part of a thing, you can setup privacy rules that mean the file is private.

That’s what I did. But once the file is private it won’t go through the API connector. Even if the privacy rule say that the user can view the attached file.

Please note that the concept of “private” in the API connector is about making that data available for further use in expressions.

Yes, but I’m not talking about this private option in the API connector ; the issue is about sending through the API connector private files, i.e. files that have been attached to a thing to control who can access it

Privacy rules do not work for backend logic. They are meant to allow or to limit data to be sent to the browser.

Perhaps creating a file object with a file field and a private? yes/no may help. Instead of having a field of type file in the object … have this file object in the object and use conditionality to private? yes.

Hey @henri02,

Same issue here, I can’t send a private file through the API connector.
Did you find a solution ?

So I hope this will help you guys.
So this is the only way I found (after a looot of time on this issue…)to send a private file through an API.
I generated a token in the Settings/API section.
Then before to use the encoded in base 64 function on the file you need to add the token into the file url by adding: /?api_token=xxxx
with “xxxx” the api token generated previously.
Here screenshots:
In the delimiter i add a “space”

1 Like

Thanks, duuuude!

This just solved my problem. I’m a bit concerned to pass my API key to an external server though.

1 Like

Hey @rico.trevisan and @akoziol
I’ve run into the same issue, trying to send a private file via an API.

Wondering if you can help.

I’ve tried calling the API via both front end and back end.

In the backend example below, i’ve set everything up to match the above but i’m getting an error when running the WF

Any help appriciated!!!