Reputation: 1
I have a bespoke back office system that I'm attempting to use populate a Magento 2.0 test bed product catalog via the Soap API's.
I've had good success with most attributes, but when I attempt to upload a base64 encoded image with the call, I get
"There is no MediaGalleryEntryConverter for given type" in the XML response.
I can't find any information about what this convertor is, or should be ?
The file I am uploading is a jpeg, and I've used various permutations of this excellent post Uploading images via the Magento SOAP API in an attempt to gain success.
Ideally, I'd rather just have the API product save reference an external web link for the file as they are all already hosted, or even an NFS mount on the local webserver file system but I've found no examples of how to achieve this on 2.0.
The Magento build is on Ubuntu, and I confess to being more of a windows man that Linux, but did feel confident I'd got it right, including directory permissions etc.
I'm at a loss as to whether my Magento / linux build is to blame, or my code / image file.
Has anyone seen anything similar, or got any 2.0 experience that might help me diagnose this issue ?
Thanks in advance.
Upvotes: 0
Views: 886
Reputation: 21
I had the same problem. As it turns out, the "mediaType" attribute in my catalogProductAttributeMediaGalleryManagementV1Create request was set to "png" but should be set to "image".
Internally, Magento tries to match the "mediaType" with the available media converters, see Magento\Catalog\Model\Product\Attribute\Backend\Media\EntryConverterPool:getConverterByMediaType.
'sku' => 'example-sku',
'entry' => [
'types' => ['image',],
//should be "image" in your case
'mediaType' => 'image',
'label' => 'Test Label',
'position' => 1,
'disabled' => false,
'file' => './',
'content' => [
'base64EncodedData' => '<base64 encoded image file content>',
'type' => 'image/png',
'name' => 'dummy.png',
],
]
Upvotes: 1