Hey everyone! ![]()
I’m hoping someone can point me in the right direction here. We’re building a custom chat widget using the WebSocket Guest API - specifically, we’re trying to get file uploads working reliably! We’ve got around 800 agents, and this is becoming a real pain point.
Everything seems set up correctly, but we’re seeing intermittent failures when users attempt to upload files larger than about 2MB. The API is responding with a 400 Bad Request, and the error message in the console is pretty unhelpful: "{\"error\":\"Invalid request\",\"message\":\"fileSize\"}". It’s just… fileSize? ![]()
We’re using the sendMessage method with the attachment parameter, and we’ve verified that the file data is being correctly serialized and sent as a base64 encoded string. We’re on Genesys Cloud v38.0.0 and using the latest Guest API SDK (v3.1.2). The Architect flow has a simple “Send Web Chat Message” node, nothing custom there.
The interesting thing is, smaller files (under 2MB) upload perfectly every time! It feels like there’s a size limit being enforced somewhere, but we can’t find any documentation specifying a hard limit on file sizes for the Guest API. We’ve checked our tenant’s file upload limits in Admin - those are set to 25MB.
Here’s a snippet of the code we’re using:
const payload = {
text: 'Here’s my file!',
attachment: {
filename: 'report.pdf',
contentType: 'application/pdf',
content: base64File
}
};
chat.sendMessage(payload)
.then(response => console.log('Message sent!', response))
.catch(error => console.error('Error sending message', error));
We’ve been poking around in the network tab, and it looks like the entire payload is being sent - it isn’t getting truncated before the error. It’s just the API seemingly rejecting the request. The errors aren’t consistent either, sometimes it’s immediate, other times it takes a few seconds.
Is there a size limit that’s not documented? Or could this be a server-side issue? We’ve tried different file types (PDF, JPG, DOCX) and it doesn’t seem to be file-type specific. It’s just large files, and it’s happening randomly. It’s really frustrating! ![]()
Any thoughts?