0
我使用的是亞馬遜實現(FBA)庫存API(https://developer.amazonservices.com/doc/fba/inventory/v20101001/php.html/185-9758808-3007701),但執行「ListInventorySupplySample.php」後出現以下錯誤。任何人都可以請幫我知道出了什麼問題。訪問在使用亞馬遜FBA庫存API時被拒絕API
$request = new FBAInventoryServiceMWS_Model_ListInventorySupplyRequest();
$skus= new FBAInventoryServiceMWS_Model_SellerSkuList();
$skus->setmember(<sku>);
$request->setSellerId(SELLER_ID);
$request->setSellerSkus($skus);
$request->setMarketplace(MARKET_PLACE_ID);
$request->setQueryStartDateTime(date(DATE_FORMAT,strtotime(date("Y-m-d"). ' - 10 days')));
invokeListInventorySupply($service, $request);
粘貼請求。
FBAInventoryServiceMWS_Model_ListInventorySupplyRequest Object
(
_fieldsrotected => Array
(
SellerId => Array
(
FieldValue =>
FieldType => string
)
Marketplace => Array
(
FieldValue =>
FieldType => string
)
SellerSkus => Array
(
FieldValue =>
FieldType => FBAInventoryServiceMWS_Model_SellerSkuList
)
QueryStartDateTime => Array
(
FieldValue => 2014-09-23T00:00:00Z
FieldType => string
)
ResponseGroup => Array
(
FieldValue =>
FieldType => string
)
)
)
粘貼以下回復。
HTTP/1.1 401 Unauthorized
Date: Fri, 03 Oct 2014 05:43:55 GMT
Server: AmazonMWS
x-mws-request-id: 0d956be3-5811-40f8-9084-4fbd77a83936
x-mws-timestamp: 2014-10-03T05:43:55.676Z
x-mws-response-context: 6n6IpwjyWO/qMfDqEazU02NkR09zL//rlcQMgApvMkfE7zhCMq2n2OtOE0y0F7AT4rO4RyslSkY=
Content-Type: text/xml
Content-Length: 295
Vary: User-Agent
<?xml version="1.0"?>
<ErrorResponse xmlns="http://mws.amazonaws.com/FulfillmentInventory/2010-10-01/">
<Error>
<Type>Sender</Type>
<Code>AccessDenied</Code>
<Message>Access denied</Message>
</Error>
<RequestID>0d956be3-5811-40f8-9084-4fbd77a83936</RequestID>
</ErrorResponse>
你如何授權你的API調用? – 2014-10-06 06:28:32
其他MWS呼叫有效嗎?你有沒有仔細檢查你的php代碼中的MWS憑證? (我假設你使用亞馬遜的PHP庫,所以簽名計算應該沒問題) – Hazzit 2014-10-06 23:44:40
是的,我檢查了憑據。我用請求參數更新了問題。請檢查。 – 2014-10-07 05:31:52