This article presents possible use cases and sample flows that you can support. It provides a useful starting point as you plan your implementation.
If you want to share an image or document through a communication channel, you can upload the file to the Media Manager and include it in a message.
To upload a media file and send it in a message:
Call Generate File Upload URL with the specified fileName and mimeType to retrieve a secure upload URL.
Upload the file to the uploadUrl, returned by the Generate File Upload URL method, using a standard HTTP POST request. See the Upload API for an example on how to upload a file to the Media Manager.
Call Send Message to send a basic message with the uploaded media file. Specify the file metadata (file ID, display name, and thumbnail URL) returned in the Upload response.
To prevent upload failures and inform Wix users about their storage limits, you can monitor a site's storage quota usage.
To monitor storage usage:
Call Get Storage Quota to retrieve current usage and total quota limits.
Calculate the remaining storage available by subtracting totalUsage from totalQuota.
Display storage information to Wix users or implement warnings when approaching limits.
In your file upload flow, handle upload failures that occur when storage limits exceed the quota, and inform Wix users they need to free up space or upgrade their storage plan.