My current config is completely failing when attempting to enforce strict MIME type validation on customer file uploads in the Genesys Cloud Web Messaging channel.
I am currently integrating the Genesys Cloud Web Messaging SDK (v1.4.2) into a custom React frontend. The requirement is to allow customers to upload only PDF and JPEG files, with a maximum size of 5MB. I have configured the fileUpload options in the widget initialization, but the platform consistently rejects valid PDF files with a 415 Unsupported Media Type error, even though the Content-Type header in the request payload appears correct (application/pdf).
Here is the initialization code I am using:
const widget = new GenesysCloudWebMessaging({
orgId: 'my-org-id',
clientId: 'my-client-id',
containerId: 'gc-web-messaging-container',
fileUpload: {
enabled: true,
maxFileSize: 5242880, // 5MB
allowedTypes: ['application/pdf', 'image/jpeg']
}
});
When a user selects a valid PDF file, the browser console logs the following network error:
POST https://api.mypurecloud.com/api/v2/conversations/messaging/messages 415 (Unsupported Media Type)
The JSON body sent in the POST request looks like this:
{
"attachments": [
{
"name": "invoice.pdf",
"contentType": "application/pdf",
"size": 124000,
"data": "base64encodedstring..."
}
],
"text": "Please see attached invoice."
}
I have verified that the data field contains a valid base64 string. I also checked the Genesys Cloud API documentation for /api/v2/conversations/messaging/messages, and it states that application/pdf is supported. However, the error persists. Is there a specific server-side configuration in the Web Messaging channel settings that overrides the SDK’s allowedTypes? Or am I missing a required header in the request? I have tried adding Accept: application/json and X-Genesys-Application-Id headers, but the result is the same. Any insights on how to debug this MIME type rejection would be appreciated.