|
I find there is a SKU problem with product_media API
If I want to creat a image to an item, I use this API. but it is failed. the REASON IS CAN NOT FIND PRODUCT.error code 101.
Here is the test .
H1, I had created an item with SKU 5000093
H2, I had used catalogInventoryStockItemUpdate API and it worked successfuly.
Now here is the code for Product_Media API
--------------------------------------------------------------
$proxy = new SoapClient(’http://mag2.xxxxx.com/api/soap/?wsdl’); // host
$sessionId = $proxy->login(’apiusexxxx’, ‘123xxxxxxxxx’);
$newImage = array(
‘file’ => array(
‘name’ => ‘5000093’,
‘content’ => base64_encode(file_get_contents(’http://www.xxxxxxxxxx.com/images/5000093.jpg’)),
‘mime’ => ‘image/jpeg’
),
‘label’ => ‘Cool Image Through Soap2’,
‘position’ => 1,
‘types’ => array(’image’, ‘small_image’, ‘thumbnail’),
‘exclude’ => 0
);
echo $imageFilename = $proxy->call($sessionId, ‘product_media.create’, array(’5000093’, $newImage));
It return error message 101
After many many times tests. I finaly find out that if I change the item SKU(5000093) to (S5000093) MANUALY.
and rewrite the code like this
$imageFilename = $proxy->call($sessionId, ‘product_media.create’, array(’S5000093’, $newImage));
and you guess what? It worked!!
Can anybody meet the same problem like me?
All my SKU is number, to resolve the problem. should I add a letter infront of my SKU?
like
S5990999
S2645968
T3453939
.....
It will be a real problem or disaster :(
|