What is your goal?
How to send a PDF file buffer to Google Gemini API via HTTP module without empty data?
What is the problem & what have you tried?
Hi everyone,
I’m having trouble with a Make scenario where I’m 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 (Download a File).
- HTTP Module: POST request to the Gemini API passing a JSON payload with inline_data.
The Issue:
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, which triggers processing failures or 404 Not Found / structure errors.
Here is the current JSON structure in the HTTP module body:
{
“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?
Any help or working example would be greatly appreciated. Thanks!