Just in case someone ends up having the same issue when importing multiple files in the same zip file.
It's possible to have media files and media.xml zipped in one file.
ContentProperty tag describes properties of the media file. Type tag is case sensitive. (string fails - String passes)
<MediaType name="ImageFile"> <ContentType>Namespace.ImageFile, ProjName</ContentType> <ContentProperty> <Name>Description</Name> <Type>String</Type> </ContentProperty> </MediaType>
XML for importing images has to have this form
<MediaGroup mediaTypeName="ImageFile"> <Media> <IntegrationId>unique_id</IntegrationId> <Name>2158</Name> <BlobContent> <FileInArchive>name.jpg</FileInArchive> </BlobContent> <CatalogEntries> <Association> <Code>542252</Code> </Association> <Association> <Code>542252_1</Code> </Association> <!--more associations for the same image can be listed here --> </CatalogEntries> </Media> </MediaGroup> <MediaGroup mediaTypeName="ImageFile"> <Media> <IntegrationId>unique_id_1</IntegrationId> <Name>2159</Name> <BlobContent> <FileInArchive>name-1.jpg</FileInArchive> </BlobContent> <CatalogEntries> <Association> <Code>619824</Code> </Association> </CatalogEntries> </Media> </MediaGroup> </MediaImport>
Every asset file has to have MediaGroup element wrapped around it. Inside CatalogEntries it's possible to list all entries which will use one image.
Hi,
did something happen to this endpoint? All of a sudden I started to get 404. I can get token. I can import catalog with /episerver/commerce/import/catalog so routes are properly set, but when media.zip gets sent to this endpoint (and it worked earlier) I keep getting 404.
ServiceAPI.Commerce nuget is version 4.2.1
Hi,
I have tried to understand how to generate media.xml file following the instructions here and the the given XSD, but I couldn't figure it out by myself.
Currently I have images uploaded to blob storage in DXC. Catalog has been imported using the /episerverapi/commerce/import/catalog
This is what I figured out xml should look like:
If I understood correctly image and media.xml should be zipped and posted to /episerverapi/commerce/import/assets
Using Postman for posting zip file to upper mentioned URL I get 200 response but no image gets uploaded to the global assets folder.
Question is if the image and the media.xml should really be zipped prior to calling the import/assets ? Is there any real life example of how media.xml should look like in order to upload images and link them to both products and variants?
[Pasting files is not allowed]