每个人我都试图使用亚马逊MWS API并遵循指南,我可以更好地使用此代码的结果:
$AWSAccessKeyId = "XXXXXXXX";
$SellerID = "XXXXXXXXXX";
$MarketplaceId_IT = "APJ6JRA9NG5V4";
$MarketplaceId_UK = "A1F83G8C2ARO7P";
$MarketplaceId_DE = "A1PA6795UKMFR9";
$MarketplaceId_FR = "A13V1IB3VIYZZH";
$MarketplaceId_ES = "A1RKKUPIHCS9HS";
$MWSAuthToken = "XXXXXXXXXXXX";
$SecretKey = "XXXXXXXXXXXXXXXXXXXXX";
$date = date(DATE_ISO8601);
$https_request_url = "https://mws-eu.amazonservices.com/Orders/2013-09-01?AWSAccessKeyId=".$AWSAccessKeyId."&Action=ListOrders&CreatedAfter=".$date."&MWSAuthToken=".$MWSAuthToken."&MarketplaceId.Id.1=".$MarketplaceId_IT."&MarketplaceId.Id.2=".$MarketplaceId_UK."&MarketplaceId.Id.3=".$MarketplaceId_DE."&MarketplaceId.Id.4=".$MarketplaceId_FR."&MarketplaceId.Id.5=".$MarketplaceId_ES."&FulfillmentChannel.Channel.1=MFN&SellerId=".$SellerID."&SignatureVersion=2&SignatureMethod=HmacSHA256&LastUpdatedAfter=".$date."&Timestamp=".$date."&Version=2013-09-01";
$Signature = base64_encode(hash_hmac('sha256', $https_request_url, $SecretKey, true));
echo '<a href="'.$https_request_url.'&Signature='.$Signature.'HTTP/1.1Host:mws-eu.amazonservices.comx-amazon-user-agent:Algolapi/1.0(Language=Php)Content-Type:text/xml" >LINK</a>';
当我点击我的测试链接时,我收到此错误:
<ErrorResponse><Error><Type>Sender</Type><Code>InvalidParameterValue</Code><Message>Invalid query string provided - XXXXCODEXXXX - is not valid; the value of a query string parameter may not contain a '=' delimiter</Message></Error><RequestID>54e589e5-b702-4e5e-a1f7-e8f6c0362129</RequestID></ErrorResponse>
我已经看到谷歌搜索这不是一个罕见的错误,但无法理解所提供的解决方案......我被困了请求帮助。提前致谢
答案 0 :(得分:0)
您的签名可能包含&#34; =&#34;在末尾。尝试添加
$Signature = urlencode($Signature);
在打电话之前。
答案 1 :(得分:0)
您需要将字符“ =”转换为%3D