Amazon Advertising APIs for Asp.net and C #

I want to get books using the Amazon product advertising API with asp.net and C #. All manuals and codes are so confusing that they do not give you one method of finding books. Is there any single stub that can be used to call a service and retrieve books based on ISBN. thanks

+4
source share
3 answers

There is a good trial solution that you can download. http://aws.amazon.com/code/2480?_encoding=UTF8&queryArg=searchQuery&x=0&fromSearch=1&y=0&searchPath=code&searchQuery=Advertising

They give you a class called SignedRequestHelper, then you call this call:

public static void Main() { SignedRequestHelper helper = new SignedRequestHelper(MY_AWS_ACCESS_KEY_ID, MY_AWS_SECRET_KEY, DESTINATION); /* * The helper supports two forms of requests - dictionary form and query string form. */ String requestUrl; String title; /* * Here is an ItemLookup example where the request is stored as a dictionary. */ IDictionary<string, string> r1 = new Dictionary<string, String>(); r1["Service"] = "AWSECommerceService"; r1["Version"] = "2009-03-31"; r1["Operation"] = "ItemLookup"; r1["ItemId"] = ITEM_ID; r1["ResponseGroup"] = "Small"; /* Random params for testing */ r1["AnUrl"] = "http://www.amazon.com/books"; r1["AnEmailAddress"] = " foobar@nowhere.com "; r1["AUnicodeString"] = "αβγδεٵٶٷٸٹٺチャーハン叉焼"; r1["Latin1Chars"] = "ĀāĂ㥹ĆćĈĉĊċČčĎďĐđĒēĔĕĖėĘęĚěĜĝĞğĠġĢģĤĥĦħĨĩĪīĬĭĮįİıIJij"; requestUrl = helper.Sign(r1); title = FetchTitle(requestUrl); System.Console.WriteLine("Method 1: ItemLookup Dictionary form."); System.Console.WriteLine("Title is \"" + title + "\""); System.Console.WriteLine(); } 

You need to use ItemLookup (e.g. an example), but set IdType to ISBN. Then set ItemId to the actual ISBN. The following is information about ItemLookup:

docs.amazonwebservices.com/AWSECommerceService/latest/DG/index.html?ItemLookup.html

0
source

I get this when I use this sample. It looks like the API has been changed recently.

 System.InvalidOperationException: There is an error in the XML document. ---> Sy stem.InvalidOperationException: <ItemLookupResponse xmlns='http://webservices.am azon.com/AWSECommerceService/2011-08-01'> was not expected. 
0
source

To download books, install this library (Install-Package Nager.AmazonProductAdvertising) https://www.nuget.org/packages/Nager.AmazonProductAdvertising/

Example:

 var authentication = new AmazonAuthentication(); authentication.AccessKey = "accesskey"; authentication.SecretKey = "secretkey"; var wrapper = new AmazonWrapper(authentication, AmazonEndpoint.UK); //The Lord of the Rings var result = wrapper.Lookup("978-0261102385"); 
0
source

All Articles