allows you to upload files in order to send them to the end user. It also allows end users to send files to you through SDKs and various third party messaging channels. In order to help guarantee the safety of these files, there is a layer of file validation that is done before we allow such files to be sent.
will reject any files having an extension outside the following list:
If the extension is contained in the list, will also detect the mime type by reading the first bytes of the file (magic number). Any files with a mime type not corresponding to an extension in the above list will also be rejected.
Timeout: When reading the first bytes, will wait for 15 seconds for a response from the server hosting the file. After 15 seconds, the request will be aborted and the file will be rejected.
A file type validation can result in a failure in four different scenarios. Depending on the source of a file, will treat rejections differently.
A failed validation when uploading a file through the Attachments API will result in a
415 - Unsupported media type error with code
unsupported_media_type. The error description will be one of the following:
If a file fails validation when a user uploads through the Web, iOS or Android SDK, the file will be removed from the conversation and the user will see an error message explaining why.
Attachment sent by the user was retracted, file type “exe” not accepted.
When a user sends an invalid file from a 3rd party channel, can’t reject the file while providing an error message. To work around this limitation, will retract the file from the message and append one of the following error messages based on the validation result. This error message will be part of the normal
In the case where you send a message via the POST Message API by specifying a
mediaUrl, a failed validation will result in a
400 - Bad request error with code
invalid_file. The error description will be one of the following:
The API imposes a file size limit of 25MB for any file being uploaded to . Exceeding this size will result in a
413 error. There is no limit when sending files that are hosted outside the platform