使用PHP POST对Amazon AMS API进行身份验证
我从一开始就接受了这个密码。它就像广告宣传的那样有效。然而,我正试图用POST而不是GET做同样的事情,这显然是AMS建议的,也是这个特定调用如何放置在AMS草稿行上的 与GET一起工作的代码 我得到以下回应:使用PHP POST对Amazon AMS API进行身份验证,php,api,amazon,Php,Api,Amazon,我从一开始就接受了这个密码。它就像广告宣传的那样有效。然而,我正试图用POST而不是GET做同样的事情,这显然是AMS建议的,也是这个特定调用如何放置在AMS草稿行上的 与GET一起工作的代码 我得到以下回应: ( [Error] => SimpleXMLElement Object ( [Type] => Sender [Code] => InvalidParameterValue
(
[Error] => SimpleXMLElement Object
(
[Type] => Sender
[Code] => InvalidParameterValue
[Message] => Either Action or Operation query parameter must be present.
)
[RequestID] => b6d5ee02-6ace-4482-92b7-xxxxxxxxxx
)
我相信我的签名认证有问题。任何帮助都将不胜感激 我修复了POST脚本
必须在curl选项中删除CURLOPT_HTTPHEADER,并在CURLOPT_POSTFIELDS中删除$post上的que单引号
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL,"https://mws.amazonservices.es/Products/2011-10-01");
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $post);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
$response = curl_exec($ch);
$info = curl_getinfo($ch);
curl_close($ch);
header("Content-Type: text/xml;charset=UTF-8");
echo($response);
敬礼,
Josep M您好,您正在为亚马逊营销服务SAMS开发api吗?我需要一些通过AMS api获取活动和其他数据的指导。请查看以下链接:提前感谢。您好,您正在为亚马逊营销服务SAMS开发api吗?我需要一些通过AMS API获取活动和其他数据的指导。请查看以下链接:提前感谢。
(
[Error] => SimpleXMLElement Object
(
[Type] => Sender
[Code] => InvalidParameterValue
[Message] => Either Action or Operation query parameter must be present.
)
[RequestID] => b6d5ee02-6ace-4482-92b7-xxxxxxxxxx
)
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL,"https://mws.amazonservices.es/Products/2011-10-01");
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $post);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
$response = curl_exec($ch);
$info = curl_getinfo($ch);
curl_close($ch);
header("Content-Type: text/xml;charset=UTF-8");
echo($response);