Yahoo Japan Shop API:服务需要身份验证

时间:2015-06-09 08:54:55

标签: php yahoo-api

我尝试使用以下代码将产品注册到我的商店,但它返回"服务需要身份验证"

我试过的是

<?php

$api = 'https://circus.shopping.yahooapis.jp/ShoppingWebService/V1/editItem';
$appid = 'My App ID';
$params = array(
   'seller_id' => 'dicdicdic',
   'item_code' => '123456789',
   'path'  => 'TOPS',
   'name' => 'Soro Product 1',
   'price' => '999'
);

$ch = curl_init($api);
curl_setopt_array($ch, array(
    CURLOPT_POST           => true,
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_USERAGENT      => "Yahoo AppID: $appid",
    CURLOPT_POSTFIELDS     => http_build_query($params),
));

$result = curl_exec($ch);
curl_close($ch);
?>
<pre>
<?php echo htmlspecialchars(
             print_r(new SimpleXMLElement($result), true)
           ) ?>
</pre>

我找不到任何解决方案。请帮忙!!!

0 个答案:

没有答案