Has anyone been able to send a file via bubbles API connector?
I have a call ‘POST [file]’ request through the API connector (using “data-binary” type) that is working with Postman but throwing an issue when implemented into bubble? any insights would be greatly appreciated, the details are below:
swagger: “2.0”
info:
x-ibm-name: ndis-upload-file
title: NDIS Upload File
version: 2.0.0
description: Digital Partners can use the Upload Files API to share a supporting
document with NDIA
schemes:
I would interpret the documentation on the Bubble API Connector to mean they only support POST Body types of form-data or raw on top of the usual JSON. Your call requires a body type of binary, which is probably not supported by the Bubble API Connector. For files stored on Bubble’s S3 cloud the data is accessible only through Bubble’s “:encoded in base64” operator, which is definitely not what your endpoint is expecting.
If you want to send a byte or octet buffer in a POST you will have to write a custom Server Side Action that reads the base64 and buffers it back into bytes and then places the POST call inside of Bubble’s context.requestfunction. Which itself exposes the deprecated Node.js request module.
were you guys able to solve this issue? am also facing the same problem and it will be very helpful if I can get a solution to this problem , please help asap if anyone of you able to figure out how to send pdf from postman to bubble.
Like when am sending name, email ,any strings i can receive them on bubble database successfully, but in case of any pdf or json response they’re showing
{
}
I have added a field resume of type file and able to upload pdfs manually at bubble, how to make it happen from postman? @aaronsheldon@b.j.gibson@blurapps
This is a tough one because the Bubble API endpoint only accepts JSON/Text. The most architecturally expedient way around this is to serialize the binary of your file to Base 64 before you call the API. Then it can be safely incorporated into the POSTed JSON.
Once the API endpoint receives the Base 64 serialized data you will then need to create a Bubble S3 file from it and then save that to the database. I have an action for writing Bubble S3 files from Base 64. It is in the plugin called Bubble Backend Utilities, and called Write from Base 64. You can then store the returned file handle in the database.
in the first entry in the field res, I have sent converted pdf to JSON base 64 response and sent from Postman , now how to use “Write from Base 64” option of your plugin as am not able to see any direct option in plugin or database.
From your res field you will need to extract the value of the JSON field data. Then in the back-end utilities use Write from Base 64 action. Put the data into the contents field and supply a name and optionally a thing to attach to.
However, ideally when calling the Bubble Data API externally you would have placed the Base 64 data directly in the res field, instead of wrapping it in JSON.
now after receiving it in bubble database, am not getting any option to call “Write from Base 64” neither at database page nor at plugin(only available actions name is written there but they’re just text), it will be very helpful if you can tell how to do it after getting response from postman on bubble database.
Related UI client code based on native html tag for file is here Note: that the server can protect credentials/ auth for 3rd party PAAS. Note: that the stream implementation on server allows it to act as a proxy ( Node.pipes ) sending the file anywhere else.