POST

Import File


Imports a file from an external URL directly into the Media Manager.

Call this method to import files from external URLs into the Media Manager, such as files hosted on another site or server.

To import a file, you need to do one of the following:

  • Specify its MIME type in the mimeType field of the request. For example, mimeType: 'image/jpeg'.
  • Specify its extension in either the displayName or url field of the request. For example, displayName: 'Example Image.jpeg or url: https://www.example.com/image.jpeg.
  • Ensure the server hosting the file supports HEAD requests. In these cases, Wix servers can retrieve the MIME type from the hosting server.

Notes:

  • If you want to validate the media type, specify the file's expected media type in the optional mediaType field of the request. For example, mediaType: 'IMAGE'.
  • When you import a file, it's not immediately available, meaning you can't manage or use the file straight away. Learn more about knowing when a file is ready to use in the Media Manager.
Authentication

You can only call this method when authenticated as a Wix app or Wix user identity.

Permissions
Manage Inbox Messages
Learn more about app permissions.
Endpoint
POST
https://www.wixapis.com/communication-channels-media/v1/import-file

Errors
400Invalid Argument

There is 1 error with this status code.

500Internal

There is 1 error with this status code.

This method may also return standard errors. Learn more about standard Wix errors.

Did this help?