The Web API has got an endpoint that works as a bridge to the data import framework of SmartStore.NET. It allows to upload import files into the import folder of an import profile. We call it bridge because an import folder is private and for security reasons not directly accessible through the internet. This bridge allows third party applications to frequently upload import files on a secure way, which can be automatically imported by the scheduled task that is associated with each import profile. Remember, an import profile is a plan that summarize all required information to individually control an import operation.
The import files must be multipart MIME formatted thus uploaded by a single multipart form data POST request.
First, you have to specify an import profile identifier to identify the profile for which the import files are intended. There are two types of identifiers:
- Id: The SmartStore.NET internal, numeric import profile identifier.
- Name: The name of the import profile.
Use one of these types and a proper value to identify the import profile. In the example,
Id is used with a value of 12. You can also upload ZIP files which is useful for very large import files. ZIP files are always unzipped into the import folder of the profile. Additional options are:
- deleteExisting: If set to
truethen all existing files (including sub directories) are deleted. You can also upload ZIP files which is useful for very large import files. ZIP files are always unzipped into the import folder of the profile.
- startImport: If set to
truethen the import is started. The requesting customer must have the permission to execute scheduled tasks.
Existing import files are always overwritten.
The API response is similar to the response of the ProductImages endpoint:
- IsSupportedByProfile: Indicates whether the uploaded import file is not in conflict with the settings of the import profile (e.g. the file type must match).