Twilio whatsappimage to gemini app- unable toprocess input image error

:bullseye: What is your goal?

Hi,

My Make.com scenario:
Twilio WhatsApp webhook → HTTP Download a file → HTTP Make a request (Gemini API) → Dropbox → Google Sheets

HTTP Download works fine - Data field shows ff d8 ff (JPEG binary, 138KB).

Gemini HTTP module error: “Unable to process input image, INVALID_ARGUMENT”

My JSON body:
{
“contents”: [{
“parts”: [{
“inline_data”: {
“mime_type”: “image/jpeg”,
“data”: " replace( Data ; /[\n\r]/g ; “” )
}
}]
}]
}

URL: generativelanguage.googleapis.com/v1beta/models/gemini-2.5-flash:generateContent?key=API_KEY

What exact formula should go in the data field to properly send binary image to Gemini?

:thinking: What is the problem & what have you tried?

Hi, I have this Make.com scenario: Twilio WhatsApp webhook → HTTP Download a file (Basic Auth, MediaUrl0) → HTTP Make a request (Gemini API).
Getting error: ‘Unable to process input image INVALID_ARGUMENT’
HTTP Download works fine — Data field shows ff d8 ff (JPEG binary).
What exact formula should go in the Gemini HTTP body’s data field to convert binary to base64?
Model: gemini-2.5-flash, API: v1beta, inline_data”

:camera_with_flash: Screenshots (scenario flow, module settings, errors)

Hi @Avi_immigrant. Welcome to the community.

Have you tried to encode the data with base64()?
Also, what’s the size of the image, in bytes? Maybe it exceeds some limit?

Please provide more info and screenshots so we can help you better.

@damato

HI @damato

Yes I tried base64() function but got error: Base64 decoding failed for base64
Also tried replace(Data ; /[\n\r]/g ; “”) — got Unable to process input image
Image size is 138595 bytes (138KB). Content-type: image/jpeg
What exact formula should go in the data field?”

Ok, help me out here. What are you using Gemini for? To analyze the image? Why aren’t you using one of the modules from Gemini App in Make? Have you tried Gemini App - Make an API Call? Is the image going to be reused by another prompt?

We’re not sure about your proficiency level in Make, so it’s easier if you show us what you did with real screenshots, instead of telling. You can be on the right path, but making a simple syntax mistake.

@damato

Hi @damato , issue resolved! The problem was I was using fileData instead of inlineData in the JSON body. Changing it to inlineData fixed the error. Thanks for your guidance!

1 Like