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 found400 Bad Request - Missing or malformed space resource name in the request400 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 APIcredential is functioning correctly. I can utilize it with aGoogle Chatnode or anHTTP Requestnode 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:
https://chat.googleapis.com/v1/media:uploadhttps://chat.googleapis.com/upload/v1/spaces/{spaceName}/attachments:upload- The same URL with a
?filename=query parameter.
-
Request Format: I've attempted to send the file using the
HTTP Requestnode with theBody Content Typeset to bothBinary DataandForm-Data (multipart/form-data). - Multipart Payloads: I've tried constructing a
multipartrequest comprising two parts, as per Google's API specifications: a JSONmetadatapart and the binaryfilepart. - Data Management: I've employed
Merge,Set, andCodenodes to ensure that all required data (spaceName, the binarydataproperty with a validfileName) is present and accurately formatted in the item passed to the finalHTTP Requestnode. The errors persist even when hardcoding values like thespaceName. - callin.io Limitations: I encountered and circumvented a
source.on is not a functioncrash by utilizing aRead/Write Files from Disknode to save the binary data prior to the upload attempt. However, the upload still fails even with this workaround.
My Questions for the Community:
- Has anyone successfully uploaded a generated binary file to Google Chat using a custom
HTTP Requestnode? If so, could you provide the configuration details for that node? - Are there any known issues or limitations within callin.io version 1.95.3 that might explain the
HTTP Requestnode's failure to correctly construct this specificmultipart/form-datarequest? - Is the recurring
404 / 400error 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
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