Generates one or more temporary URLs for downloading a specific file in the Media Manager.
To download different assets of the file, specify the assetKeys
parameter which generates a download URL for each asset.
If no assetKey
is specified, it defaults to src
, which generates one download URL in the original file's format and quality.
Call this endpoint to grant external clients access to a private media file. Specify the expirationInMinutes
parameter to set the URL expiration time, and the expirationRedirectUrl
parameter to add a redirect url when the URL expires.
To generate a permanent URL for downloading a compressed file that contains multiple files in the Media Manager, call the Generate Files Download URL endpoint. Since this is a permanent URL, it is less secure. Therefore, to download private files, call the Generate File Download URL endpoint for each private file that you want to generate a download URL for.
You can only call this method when authenticated as a Wix app or Wix user identity.
Temporary file name used to identify the file type. For example, a file named "myFile.jpeg" identifies as an "image/jpeg" file type.
Note: The name that appears in the Media Manager is taken from the filename
parameter in the Generate File Upload Url call.
The time that it takes in minutes for the download URL to expire.
Default: 600
.
Limit: 525600
(1 year).
The redirect URL for when the temporary download URL with a token expires.
Default: A 403 Forbidden response page.
Keys for downloading different assets (format and quality) of a file.
Default: src
, key representing the original file's format and quality.
Whether the link downloads the file or opens the file in the browser.
ATTACHMENT
: The link downloads the file.INLINE
: The link opens the file in the browser.Default: ATTACHMENT
URL for downloading a specific file in the Media Manager.
curl -X POST \
'https://www.wixapis.com/site-media/v1/files/generate-file-download-url' \
-H 'Authorization: <AUTH>'
-H 'Content-Type: application/json' \
--data-binary '{
"fileId": "4acbb8_7596aeebcf5c41eca01c0d99667ac967.mp3",
"downloadFileName": "Gorillaz - Feel Good Inc.mp3",
"expirationInMinutes": "60",
"expirationRedirectUrl":"www.mysite.com/store",
"assetKeys": ["320kbs.mp3"]
}'
{
"downloadUrls": [
{
"url": "https://download-files.wixmp.com/media/4acbb8_00668eb74c164439951039ca3a2ae54a~mv2_d_6031_4456_s_4_2.jpg?token=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJ1cm46YXBwOmU2NjYzMGU3MTRmMDQ5MGFhZWExZjE0OWIzYjY5ZTMyIiwic3ViIjoidXJuOmFwcDplNjY2MzBlNzE0ZjA0OTBhYWVhMWYxNDliM2I2OWUzMiIsImF1ZCI6WyJ1cm46c2VydmljZTpmaWxlLmRvd25sb2FkIl0sImlhdCI6MTY1MjY0OTY4MCwiZXhwIjoxNjUyNjQ5NzUwLCJqdGkiOiJlODk0MDEzOTJmYzUiLCJvYmoiOltbeyJwYXRoIjoiL21lZGlhLzJhY2JiOF8wMDY2OGViNzRjMTY0NDM5OTUxMDM5Y2EzYTJhZTU0YX5tdjJfZF82MDMxXzQ0NTZfc180XzIuanBnIn1dXSwicmVkIjoid3d3Lmdvb2dsZS5jb20iLCJhdHRhY2htZW50Ijp7ImZpbGVuYW1lIjoiZWxpcmFuLmpwZyJ9fQ.P9eCCRunJcjxdFyJVOqFwvuutpyjRekAuP67BFBs8Es",
"assetKey": "320kbs.mp3"
}
]
}
There is 1 error with this status code.
This method may also return standard errors. Learn more about standard Wix errors.