What is the problem & what have you tried?
Hi everyone,
I am trying to process a bank statement PDF stored in Google Drive and send it to the Google Gemini API using a standard HTTP module.
Scenario Workflow:
- Google Drive: Download a file module.
- HTTP Module: POST request to the Gemini API passing a JSON payload with inline_data.
The PDF file is not being received correctly by the AI model. The binary buffer/base64 payload seems to be sent empty or misformatted inside inline_data.
Current JSON structure:
{
“contents”: [
{
“parts”: [
{
“text”: “Extract all transactions from this bank statement into JSON format.”
},
{
“inline_data”: {
“mime_type”: “application/pdf”,
“data”: “{{base64(2.Data)}}”
}
}
]
}
]
}
My Question:
What is the correct and verified way in Make to pass a binary PDF buffer from Google Drive into a REST API payload without sending an empty/invalid string? Do I need to use Google’s Resumable Upload API (/upload/v1beta/files) first, or is there a specific Make function to properly encode the binary file buffer before posting?
Error messages or input/output bundles
Errors received during testing:
- Endpoint routing error: 404 NOT_FOUND (“models/gemini-1.5-flash is not found for API version v1/v1beta”) when using standard endpoints.
- Payload parsing error: Data couldn’t be processed (HTTP DataError) when attempting to parse the base64-encoded binary buffer directly inside inline_data.
inline_data with base64(2.Data) often goes out empty when the Drive module is still handing you a file pointer instead of the binary bundle.
Two things that have worked here: map base64 from the binary data field on the file (not a metadata Data field), and if the PDF is more than a couple of MB, skip inline_data and upload through Gemini’s files endpoint first, then pass the file URI.
Are you seeing an empty string in the HTTP module’s output bundle, or a 400 from Gemini with empty inline_data?
The issue looks like it is coming from two separate parts of the request: the binary-to-Base64 conversion and the Gemini endpoint/model being used.
For the PDF itself, I would first verify the output of the Google Drive “Download a file” module and make sure the HTTP module is receiving the actual binary Data field. The value placed in inline_data.data must be a valid Base64 representation of the PDF bytes, not the file URL, filename, or an empty/mapped value.
I would also test the Base64 value independently before sending it to Gemini. If it is empty, the problem is happening in the Make mapping/conversion step rather than Gemini.
The 404 NOT_FOUND for gemini-1.5-flash is a separate issue. I would verify the currently supported Gemini model name and API version you’re calling, because changing the model/endpoint won’t fix an invalid PDF payload.
For a small PDF, sending it as inline_data can work. For larger files or a more robust workflow, using Gemini’s Files API first and then referencing the uploaded file can be a better approach.
So I would troubleshoot it in this order:
-
Confirm Google Drive is returning non-empty binary data.
-
Confirm Make is correctly converting that binary data to Base64.
-
Validate the generated Base64 before sending it.
-
Use a currently supported Gemini model/API endpoint.
-
If the PDF is large, consider the Gemini Files API instead of inline data.
The key is to isolate the binary conversion problem from the Gemini endpoint/model problem rather than changing both at the same time.