I am using the Google Chat card api to send a card back to a user to answer their questions. I wish to include an image within the results, however a direct URL cannot be provided since it is only exposed to the company network.
Instead I have attempted to do the following:
"image": {
"imageUrl": "data:image/png;base64, ... ",
"onClick": {
"openLink": {
"url": "https://example.com/"
}
}
}
However, I am receiving the following error message:
<HttpError 400 when requesting https://chat.googleapis.com/v1/spaces/XXXXXXXXXXX/messages?alt=json returned "Request contains an invalid argument.". Details: "Request contains an invalid argument.">
.
Is there any way I could send images using the Google Chat API that doesn't involve uploading the images to the public first, or am I doing something wrong with my implementation? The issue is not that the string is too long as the base 64 string that I am trying to send over is quite short.
The message is being sent from a python server, not from the online JavaScript based editor.