Skip to content
Troubleshooting Goo...
 
Notifications
Clear all

Troubleshooting Google Chat File Uploads: Attachment Upload Fails with 400/404

2 Posts
2 Users
0 Reactions
5 Views
pva2025
(@pva2025)
Posts: 1
New Member
Topic starter
 

Hello callin.io Community,

I've encountered a significant roadblock while developing a complex Google Chat bot and am seeking assistance from the community on a specific API call.

My Objective: I aim to construct a workflow where my bot receives messages (text or audio), generates a response using the AI Agent, converts the AI's text output into an audio file via OpenAI TTS, and then sends this generated audio file back as a reply within Google Chat.

Workflow Summary: The workflow effectively processes both text and audio inputs. Audio is transcribed, the AI Agent generates a response, and OpenAI successfully creates an .opus audio file as binary data within callin.io. All stages function perfectly until the final step of sending the reply.

The Challenge: I'm unable to successfully upload the generated audio file to Google Chat using the final HTTP Request node. I'm following the documented two-step procedure (uploading media first, then creating a message with the returned identifier), but the initial "upload" step consistently fails with an error originating from Google's servers.

Depending on the precise URL and configuration, I repeatedly receive one of the following errors:

  • 404 Not Found - The resource you are requesting could not be found
  • 400 Bad Request - Missing or malformed space resource name in the request
  • 400 Bad Request - No file found in request

Troubleshooting Steps Taken:

I've dedicated considerable time to debugging this and have verified the following:

  • Authentication: My Chat OAuth2 API credential is functioning correctly. I can utilize it with a Google Chat node or an HTTP Request node to successfully send text messages.
  • Google Cloud Project: The Google Chat API is enabled . My OAuth Consent screen displays the correct scopes (chat.messages , chat.spaces , chat.memberships ). My application is in "Testing" mode, with my user correctly designated as a Test User.
  • Google Workspace: My administrator settings permit third-party application access.
  • API Endpoints: I've experimented with several variations of the upload URL, referencing Google's documentation and community recommendations, including:

  • Request Format: I've attempted to send the file using the HTTP Request node with the Body Content Type set to both Binary Data and Form-Data (multipart/form-data) .

  • Multipart Payloads: I've tried constructing a multipart request comprising two parts, as per Google's API specifications: a JSON metadata part and the binary file part.
  • Data Management: I've employed Merge , Set , and Code nodes to ensure that all required data (spaceName , the binary data property with a valid fileName ) is present and accurately formatted in the item passed to the final HTTP Request node. The errors persist even when hardcoding values like the spaceName .
  • callin.io Limitations: I encountered and circumvented a source.on is not a function crash by utilizing a Read/Write Files from Disk node to save the binary data prior to the upload attempt. However, the upload still fails even with this workaround.

My Questions for the Community:

  1. Has anyone successfully uploaded a generated binary file to Google Chat using a custom HTTP Request node? If so, could you provide the configuration details for that node?
  2. Are there any known issues or limitations within callin.io version 1.95.3 that might explain the HTTP Request node's failure to correctly construct this specific multipart/form-data request?
  3. Is the recurring 404 / 400 error a recognized problem for Google Chat applications in "Testing" mode (i.e., is this functionality exclusive to published marketplace applications)?

I believe I have exhausted all potential troubleshooting avenues. Any insights or alternative approaches the community might suggest would be greatly appreciated.

Thank you!
Phil

 
Posted : 15/06/2025 7:37 am
Sudhanshu_Sharma
(@sudhanshu_sharma)
Posts: 13
Active Member
 

Hi,

Welcome to the community.

Thanks for sharing the details.


It’s been 4 hours since I reviewed your post, and after trying to find the exact solution, I'm happy to share that I finally made it work...

So...

Here is the solution that enables you to upload any supported file to Google Chat.

Now it’s time to share some not-so-good news.

  • While I was working on your request, I found a solution that technically works: you can send an audio file to a Google Chat space as an attachment.
  • However, after getting everything working, I realized that it’s not precisely what you intended.
    – Your objective was to send an inline voice message, similar to this (screenshot below):
  • Unfortunately, the Google Chat API does not currently support sending inline audio messages. There is no method (at least for now) to replicate the built-in voice message functionality using the public API.
  • So yes — you can upload and send audio files, but they will be presented as standard file attachments, like this:

    The recipient will need to download or open the file manually to listen to it — it will not play inline within the chat.

Hope this helps!

– Sudhanshu

 
Posted : 15/06/2025 6:26 pm
Share: