Question

I'm trying to consume amazon product affiliate API and it has been a really confusing experience.

I've signed up for AWS so I have my ACCESS_KEY_ID and SECRET_ACCESS_KEY additionally I've signed up on https://affiliate-program.amazon.com/ and have gotten my Tracking ID

Now when trying to make a request with this 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

I get an error

<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>

I've supplied all the parameters required but not sure why the information isn't matching. If I remove the AssociateTag parameter from the URL then I get this error:

<Error>
   <Code>AWS.MissingParameters</Code>
   <Message>Your request is missing required parameters. Required parameters include AssociateTag.</Message>
</Error>

Is AssociateTag something different than the Tracking ID that I received after signing up on amazon link

I'm trying to get the sample code form http://aws.amazon.com/code/Product-Advertising-API/2478 to execute. Unless there is a better option out there....

Était-ce utile?

La solution

It works for me. Could be something wrong in your signature. AssociateTag is your 'Associates ID' that you get after sign up for affiliate not any tracking ID. And I sign for Amazon.co.uk Associates.

http://ecs.amazonaws.com/onca/xml?AWSAccessKeyId=AKIAIAAPUKLVP6OGAT4Q&AssociateTag=jay048-21&ItemId=0545010225&Operation=ItemLookup&ResponseGroup=Small&Service=AWSECommerceService&Timestamp=2014-03-05T17%3A14%3A31Z&Version=2009-03-31&Signature=Vfto8GdjP875KGwYrpe1QyfDkpUr3HDkQAyAcyyI4n0%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>
Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top