GetMyFeesEstimate API亚马逊vba

时间:2018-01-07 10:44:35

标签: excel vba api amazon

我从亚马逊获得合理答案时遇到问题。问题仅出在GetMyFeesEstimate。像GetMyPriceForASIN这样的其他东西可行。我试图通过VBA / Excel获得回复。

来自亚马逊的示例代码:

https://mws.amazonservices.de/Products/2011-10-01?
FeesEstimateRequestList.FeesEstimateRequest.1.MarketplaceId=A1PA6795UKMFR9
&FeesEstimateRequestList.FeesEstimateRequest.1.IdType=ASIN
&FeesEstimateRequestList.FeesEstimateRequest.1.IdValue=3828934897
&FeesEstimateRequestList.FeesEstimateRequest.1.IsAmazonFulfilled=true
&FeesEstimateRequestList.FeesEstimateRequest.1.Identifier=request1
&FeesEstimateRequestList.FeesEstimateRequest.1.PriceToEstimateFees.ListingPrice.CurrencyCode=EUR
&FeesEstimateRequestList.FeesEstimateRequest.1.PriceToEstimateFees.ListingPrice.Amount=30.00
&FeesEstimateRequestList.FeesEstimateRequest.1.PriceToEstimateFees.Shipping.CurrencyCode=EUR
&FeesEstimateRequestList.FeesEstimateRequest.1.PriceToEstimateFees.Shipping.Amount=3.99
&FeesEstimateRequestList.FeesEstimateRequest.1.PriceToEstimateFees.Points.PointsNumber=0
&AWSAccessKeyId=XXXXXXXXXXXXX
&Action=GetMyFeesEstimate
&SellerId=XXXXXXXXXXXXXX
&SignatureMethod=HmacSHA256
&SignatureVersion=2
&Timestamp=2018-01-07T10%3A26%3A27Z&Version=2011-10-01&Signature=bJJJorhyeKwejuddJs6Z%2BVYZZmKtm0CG2GAXTrShyZM%3D

如果我尝试将此签名请求与我的数据一起使用,我会收到以下错误:

  

我们计算的请求签名与您提供的签名不符。检查您的AWS Secret Access Key和签名方法。有关详细信息,请参阅服务文档。

有人可以帮我这个吗?

Here是来自亚马逊的文档。

1 个答案:

答案 0 :(得分:0)

您还没有显示有关如何签署请求的代码。

由于您已经成功使用了一个API,您是否可以检查您使用的十进制值在签名字符串和POST请求中是否完全相同? 有时excel将30.0之类的值存储为0.3E02或类似的东西,这会导致签名字符串与您的发布请求不同。

我使用Amazon Scratchpad创建了一个POST,并获得了有关签名字符串的指导。 请转到https://mws.amazonservices.com/scratchpad/index.html 输入左侧的详细信息并单击“提交”后,您可以看到“请求详细信息”和“签名字符串”。如果您完全按照指定的那样创建请求并在那里完全按照指定签名,那么您就不应该有唱歌问题。

以下是您的请求示例:

POST / Products / 2011-10-01?AWSAccessKeyId =

&安培;动作= GetMyFeesEstimate

&安培; SellerId = XXXXXXXXXXXXXX

&安培; SignatureVersion = 2

&安培;时间戳= 2018-06-12T04%3A19%3A55Z

&安培;版本= 2011-10-01

&安培;签名= vJLewLVH7FmUD8cpST8dD51GBUJkt6Aj9FADGLoCjNQ%3D

&安培;是SignatureMethod = HmacSHA256

&安培; FeesEstimateRequestList.FeesEstimateRequest.1.MarketplaceId = A1PA6795UKMFR9

&安培; FeesEstimateRequestList.FeesEstimateRequest.1.IdType = ASIN

&安培; FeesEstimateRequestList.FeesEstimateRequest.1.IdValue = 3828934897

&安培; FeesEstimateRequestList.FeesEstimateRequest.1.IsAmazonFulfilled =真

&安培; FeesEstimateRequestList.FeesEstimateRequest.1.Identifier = request1

&安培; FeesEstimateRequestList.FeesEstimateRequest.1.PriceToEstimateFees.ListingPrice.Amount = 30.00

&安培; FeesEstimateRequestList.FeesEstimateRequest.1.PriceToEstimateFees.ListingPrice.CurrencyCode = EUR

&安培; FeesEstimateRequestList.FeesEstimateRequest.1.PriceToEstimateFees.Shipping.Amount = 3.99

&安培; FeesEstimateRequestList.FeesEstimateRequest.1.PriceToEstimateFees.Shipping.CurrencyCode = EUR

& FeesEstimateRequestList.FeesEstimateRequest.1.PriceToEstimateFees.Points.PointsNumber = 0 HTTP / 1.1

主持人:mws.amazonservices.com

x-amazon-user-agent:AmazonJavascriptScratchpad / 1.0(语言= Javascript)

Content-Type:text / xml

这是要签名的字符串。 请注意,您必须将CHR(10)换成新行。不要将VBCRLF放在字符串中。

POST mws.amazonservices.com /产品/ 2011-10-01 AWSAccessKeyId =安培;动作= GetMyFeesEstimate&安培; FeesEstimateRequestList.FeesEstimateRequest.1.IdType = ASIN&安培; FeesEstimateRequestList.FeesEstimateRequest.1.IdValue = 3828934897&安培; FeesEstimateRequestList.FeesEstimateRequest.1.Identifier = request1&安培; FeesEstimateRequestList.FeesEstimateRequest.1.IsAmazonFulfilled =真安培; FeesEstimateRequestList。 FeesEstimateRequest.1.MarketplaceId = A1PA6795UKMFR9&安培; FeesEstimateRequestList.FeesEstimateRequest.1.PriceToEstimateFees.ListingPrice.Amount = 30.00&安培; FeesEstimateRequestList.FeesEstimateRequest.1.PriceToEstimateFees.ListingPrice.CurrencyCode = EUR&安培; FeesEstimateRequestList.FeesEstimateRequest.1.PriceToEstimateFees.Points.PointsNumber = 0&安培; FeesEstimateRequestList.FeesEstimateRequest.1.PriceToEstimateFees.Shipping.Amount = 3.99&安培; FeesEstimateRequestList.FeesEstimateRequest.1.PriceToEstimateFees.Shipping.CurrencyCode = EUR&安培; SellerId = XXXXXXXXXXXXXX&安培;是SignatureMethod = HmacSHA256&安培; SignatureVersion = 2及时间戳= 2018-06-12T04% 3A19%3A55Z&安培; Ve的rsion = 2011-10-01