Has anyone tried calling an api on bubble.io?

How can I get the picture input from ‘body(JSON)’?

1 Like

Yes, it is possible to call Gemini API from “Modified by moderator” with image input if we format the image with base64 encoded in the JSON body.

Example JSON:

{
"contents: [
{
"role":"user",
"parts":[
{
"inline_data":{
"mime_type":"image/png",
"data":"<BASE64_IMAGE_STRING>"
}
},
{
"text": "Describe the contents of the image in detail."
}
]
}
]
}

Note:-

  1. Data must be the raw base64 string of the image and not the URI prefix like data:image and also the mime_type is image/png to image/jpeg.
  2. In “Modified by moderator” we use the API connector plugin and Authorization: Bearer Your_api_key.

Then you may paste the JSON body in the request body section and use the POST method and try.