Reputation: 201
I'm trying to retrieve data from 'Amazon Product Advertising API', and I see that I need to sign my request, and then the response is an XML document which should be parsed.
I wonder if there is any library which I can send my requests throught, and recieve the response back as an object.
If not, what should I do to convert those XML reponses to an object ? I've read about schemas, but where do I get those schemas from and where do I get from the defention for the response objects so I could define them my self.
Thanks alot!
Upvotes: 2
Views: 2495
Reputation: 4275
You can use the following nuget package
PM> Install-Package Nager.AmazonProductAdvertising
Example:
var authentication = new AmazonAuthentication();
authentication.AccessKey = "accesskey";
authentication.SecretKey = "secretkey";
var client = new AmazonProductAdvertisingClient(authentication, AmazonEndpoint.DE);
//Search
var result = await client.SearchItemsAsync("canon eos");
//Lookup
var result = await client.GetItemsAsync("B00BYPW00I");
Upvotes: 5
Reputation: 185
There is a library that helps you sign requests AND process the responses by converting the XML into a relatively easy-to-use object. I've been using it for a few weeks now and wrote my own helper classes to really make querying the API fast and easy.
I wrote a demo console C# app where you can just plug in your Amazon credentials and start playing around here: https://github.com/zoenberger/AmazonProductAdvertising
I also answered a similar question here: https://stackoverflow.com/a/33617604/5543992
Upvotes: 0