Java 尝试使用Amazon产品附属API时出错
我正在尝试使用亚马逊产品附属API,这是一个非常令人困惑的体验 我已经注册了AWS,所以我有我的Java 尝试使用Amazon产品附属API时出错,java,rest,amazon-web-services,amazon,Java,Rest,Amazon Web Services,Amazon,我正在尝试使用亚马逊产品附属API,这是一个非常令人困惑的体验 我已经注册了AWS,所以我有我的ACCESS\u KEY\u ID和SECRET\u ACCESS\u KEY此外,我还注册了https://affiliate-program.amazon.com/并已获得我的跟踪ID 现在,当尝试使用此URL发出请求时 http://ecs.amazonaws.com/onca/xml? AWSAccessKeyId=AKIAI4E9BPWYGSC7VNZQ &ItemId=054501
ACCESS\u KEY\u ID
和SECRET\u ACCESS\u KEY
此外,我还注册了https://affiliate-program.amazon.com/
并已获得我的跟踪ID
现在,当尝试使用此URL发出请求时
http://ecs.amazonaws.com/onca/xml?
AWSAccessKeyId=AKIAI4E9BPWYGSC7VNZQ
&ItemId=0545010225
&Operation=ItemLookup
&ResponseGroup=Small
&Service=AWSECommerceService
&Timestamp=2014-03-05T15%3A55%3A46Z
&Version=2009-03-31
&Signature=mb6Stjz4I5GHV51bxVyACS4T%2FwGjplkVymW8eLDoh4Q%3D
&AssociateTag=sample026-20
我犯了一个错误
<Error>
<Code>SignatureDoesNotMatch</Code>
<Message>The request signature we calculated does not match the signature you provided.
Check your AWS Secret Access Key and signing method.
Consult the service documentation for details.</Message>
</Error>
我已经提供了所需的所有参数,但不确定为什么信息不匹配。
如果我从URL中删除AssociateTag
参数,则会出现以下错误:
<Error>
<Code>AWS.MissingParameters</Code>
<Message>Your request is missing required parameters. Required parameters include AssociateTag.</Message>
</Error>
AssociateTag
是否与我注册后收到的跟踪ID
有所不同
我正在尝试获取示例代码表单
http://aws.amazon.com/code/Product-Advertising-API/2478
执行。除非有更好的选择……它适合我。你的签名可能有问题。AssociateTag是您注册会员后获得的“会员ID”,而不是任何跟踪ID。我为Amazon.co.uk Associates注册
5f5e44b1-8005-4b27-846a-9959775bdf24
0.0143640000000000
真的
阿辛
0545010225
小的
全部的
0545010225
http://www.amazon.com/Harry-Potter-Deathly-Hallows-Book/dp/0545010225%3FSubscriptionId%3DAKIAIAAPUKLVP6OGAT4Q%26tag%3Djay048-21%26链接代码%3Dxm2%26营地%3D2025%26创意%3D165953%26创意销售%3D0545010225
技术细节
http://www.amazon.com/Harry-Potter-Deathly-Hallows-Book/dp/tech-data/0545010225%3FSubscriptionId%3DAKIAIAAPUKLVP6OGAT4Q%26tag%3Djay048-21%26链接代码%3Dxm2%26营地%3D2025%26创意%3D386001%26创意销售%3D0545010225
添加到婴儿注册表
http://www.amazon.com/gp/registry/baby/add-item.html%3Fasin.0%3D0545010225%26SubscriptionId%3DAKIAIAAPUKLVP6OGAT4Q%26tag%3Djay048-21%26链接代码%3Dxm2%26营地%3D2025%26创意%3D386001%26创意销售%3D0545010225
添加到婚礼登记处
http://www.amazon.com/gp/registry/wedding/add-item.html%3Fasin.0%3D0545010225%26SubscriptionId%3DAKIAIAAPUKLVP6OGAT4Q%26tag%3Djay048-21%26链接代码%3Dxm2%26营地%3D2025%26创意%3D386001%26创意销售%3D0545010225
添加到愿望列表
http://www.amazon.com/gp/registry/wishlist/add-item.html%3Fasin.0%3D0545010225%26SubscriptionId%3DAKIAIAAPUKLVP6OGAT4Q%26tag%3Djay048-21%26链接代码%3Dxm2%26营地%3D2025%26创意%3D386001%26创意销售%3D0545010225
告诉朋友
http://www.amazon.com/gp/pdp/taf/0545010225%3FSubscriptionId%3DAKIAIAAPUKLVP6OGAT4Q%26tag%3Djay048-21%26链接代码%3Dxm2%26营地%3D2025%26创意%3D386001%26创意销售%3D0545010225
所有客户评论
http://www.amazon.com/review/product/0545010225%3FSubscriptionId%3DAKIAIAAPUKLVP6OGAT4Q%26tag%3Djay048-21%26链接代码%3Dxm2%26营地%3D2025%26创意%3D386001%26创意销售%3D0545010225
所有报价
http://www.amazon.com/gp/offer-listing/0545010225%3FSubscriptionId%3DAKIAIAAPUKLVP6OGAT4Q%26tag%3Djay048-21%26链接代码%3Dxm2%26营地%3D2025%26创意%3D386001%26创意销售%3D0545010225
J.K.罗琳
玛丽·格兰德普雷
阿瑟·A·莱文图书
书
哈利·波特与死亡圣器(第七册)
您是如何计算签名的?签名=mb6Stjz4I5GHV51bxVyACS4T%2FwGjplkVymW8eLDoh4Q%3D
<ItemLookupResponse xmlns="http://webservices.amazon.com/AWSECommerceService/2011-08-01">
<OperationRequest>
<HTTPHeaders>
<Header Name="UserAgent" Value="Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/33.0.1750.146 Safari/537.36"/>
</HTTPHeaders>
<RequestId>5f5e44b1-8005-4b27-846a-9959775bdf24</RequestId>
<Arguments>
<Argument Name="Operation" Value="ItemLookup"/>
<Argument Name="Service" Value="AWSECommerceService"/>
<Argument Name="Signature" Value="Vfto8GdjP875KGwYrpe1QyfDkpUr3HDkQAyAcyyI4n0="/>
<Argument Name="AssociateTag" Value="jay048-21"/>
<Argument Name="Version" Value="2009-03-31"/>
<Argument Name="ItemId" Value="0545010225"/>
<Argument Name="AWSAccessKeyId" Value="AKIAIAAPUKLVP6OGAT4Q"/>
<Argument Name="Timestamp" Value="2014-03-05T17:14:31Z"/>
<Argument Name="ResponseGroup" Value="Small"/>
</Arguments>
<RequestProcessingTime>0.0143640000000000</RequestProcessingTime>
</OperationRequest>
<Items>
<Request>
<IsValid>True</IsValid>
<ItemLookupRequest>
<IdType>ASIN</IdType>
<ItemId>0545010225</ItemId>
<ResponseGroup>Small</ResponseGroup>
<VariationPage>All</VariationPage>
</ItemLookupRequest>
</Request>
<Item>
<ASIN>0545010225</ASIN>
<DetailPageURL>
http://www.amazon.com/Harry-Potter-Deathly-Hallows-Book/dp/0545010225%3FSubscriptionId%3DAKIAIAAPUKLVP6OGAT4Q%26tag%3Djay048-21%26linkCode%3Dxm2%26camp%3D2025%26creative%3D165953%26creativeASIN%3D0545010225
</DetailPageURL>
<ItemLinks>
<ItemLink>
<Description>Technical Details</Description>
<URL>
http://www.amazon.com/Harry-Potter-Deathly-Hallows-Book/dp/tech-data/0545010225%3FSubscriptionId%3DAKIAIAAPUKLVP6OGAT4Q%26tag%3Djay048-21%26linkCode%3Dxm2%26camp%3D2025%26creative%3D386001%26creativeASIN%3D0545010225
</URL>
</ItemLink>
<ItemLink>
<Description>Add To Baby Registry</Description>
<URL>
http://www.amazon.com/gp/registry/baby/add-item.html%3Fasin.0%3D0545010225%26SubscriptionId%3DAKIAIAAPUKLVP6OGAT4Q%26tag%3Djay048-21%26linkCode%3Dxm2%26camp%3D2025%26creative%3D386001%26creativeASIN%3D0545010225
</URL>
</ItemLink>
<ItemLink>
<Description>Add To Wedding Registry</Description>
<URL>
http://www.amazon.com/gp/registry/wedding/add-item.html%3Fasin.0%3D0545010225%26SubscriptionId%3DAKIAIAAPUKLVP6OGAT4Q%26tag%3Djay048-21%26linkCode%3Dxm2%26camp%3D2025%26creative%3D386001%26creativeASIN%3D0545010225
</URL>
</ItemLink>
<ItemLink>
<Description>Add To Wishlist</Description>
<URL>
http://www.amazon.com/gp/registry/wishlist/add-item.html%3Fasin.0%3D0545010225%26SubscriptionId%3DAKIAIAAPUKLVP6OGAT4Q%26tag%3Djay048-21%26linkCode%3Dxm2%26camp%3D2025%26creative%3D386001%26creativeASIN%3D0545010225
</URL>
</ItemLink>
<ItemLink>
<Description>Tell A Friend</Description>
<URL>
http://www.amazon.com/gp/pdp/taf/0545010225%3FSubscriptionId%3DAKIAIAAPUKLVP6OGAT4Q%26tag%3Djay048-21%26linkCode%3Dxm2%26camp%3D2025%26creative%3D386001%26creativeASIN%3D0545010225
</URL>
</ItemLink>
<ItemLink>
<Description>All Customer Reviews</Description>
<URL>
http://www.amazon.com/review/product/0545010225%3FSubscriptionId%3DAKIAIAAPUKLVP6OGAT4Q%26tag%3Djay048-21%26linkCode%3Dxm2%26camp%3D2025%26creative%3D386001%26creativeASIN%3D0545010225
</URL>
</ItemLink>
<ItemLink>
<Description>All Offers</Description>
<URL>
http://www.amazon.com/gp/offer-listing/0545010225%3FSubscriptionId%3DAKIAIAAPUKLVP6OGAT4Q%26tag%3Djay048-21%26linkCode%3Dxm2%26camp%3D2025%26creative%3D386001%26creativeASIN%3D0545010225
</URL>
</ItemLink>
</ItemLinks>
<ItemAttributes>
<Author>J. K. Rowling</Author>
<Creator Role="Illustrator">Mary GrandPré</Creator>
<Manufacturer>Arthur A. Levine Books</Manufacturer>
<ProductGroup>Book</ProductGroup>
<Title>Harry Potter and the Deathly Hallows (Book 7)</Title>
</ItemAttributes>
</Item>
</Items>
</ItemLookupResponse>