I've been trying to import several thousand product images into a Magento 1.8.1.0 website using the SOAP API.
Although some have been imported, several hundred were not.
To try and find where this has happened I am using the following API command:
catalog_product_attribute_media.list
This is returning an error for some SKU's: "Product not exists". This is a genuine API error documented at http://www.magentocommerce.com/wiki/doc/webservices-api/api/catalog_product_attribute_media#faults
However, the SKU's where this is happening definitely exist within Magento, as I can search for them and see them in the Admin panel.
$result = $client->call($session, 'catalog_product_attribute_media.list', '452103');
The above code will cause an Exception saying "Product not exists" meaning it can't find anything for the SKU 452103. But if I search for SKU 452103 in the Admin panel it's there!
What's strange is that if I get the Magento Product ID for that SKU (in the above example it happens to be 3478) and run the following it works without error:
$result = $client->call($session, 'catalog_product_attribute_media.list', '3478');
Does anyone know what I'm doing wrong or why this might happen? The API documentation says what I'm passing as the second parameter to call() can be either the Product ID or the SKU.
I can only use the SKU in practice because my source data doesn't know what the Magento Product ID's are, but the SKU has been imported without modification. The code above where I've used Product ID = 3478 is just something I put to test whether it would output anything but I had to find this Product ID manually, which isn't practical for the number of images I need to fix.