100 likes | 521 Views
Using Amazon Web Services (AWS). Amazon Web Services (AWS). A set of tools for providing remote access to Amazon product information to third-party applications Includes ecommerce, cloud computing, application hosting, and many other features.
E N D
Amazon Web Services (AWS) • A set of tools for providing remote access to Amazon product information to third-party applications • Includes ecommerce, cloud computing, application hosting, and many other features. • We will be using the Product Advertising API for getting Amazon product information
Getting an Amazon AWS Account • Go to http://aws.amazon.com/ • Click the button to Sign up for a free Amazon Web Services Account • Follow the directions • At this point you have an account
Obtaining your AWS Access Keys • Sign in to your AWS account • Go to the Account page: http://aws.amazon.com/account/ • Click the Security Credentials link • Here you can see your Access Key and your Secret Access Key. You will need both of these
Obtaining Your Associate Tag • In addition to Access Keys, you also need to sign up as an Amazon Associate. • Go to this site and follow the instructinos: • https://affiliate-program.amazon.com/ • At this point you are ready to start using the Product API!
Amazon.Com’s Product Advertising API • http://docs.amazonwebservices.com/AWSECommerceService/latest/DG/Welcome.html • In particular, look at: • Programming Guide (especially Visual Introduction and Requests – REST) • API Reference • Pay special attention to these two operations: • ItemSearch – retrieve a list of products matching a keyword search • ItemLookup – retrieve the details for a selected product
Using Amazon’s Signed Request Helper Page to Generate Requests • You can go to this site to see how your public and private keys are used to turn UNSIGNED requests into SIGNED requests: • http://associates-amazon.s3.amazonaws.com/signed-requests/helper/index.html
How Signed Request HelperWorks • You enter your public and private keys in the fields at the top • You enter an unsigned URL into the textbox. Be sure to include your AssociateTag. Also, make sure there are no spaces. • It will produce a signed URL (a REST query) by applying the HMAC algorithm for creating a signature and authenticating the request. • Note: this will also be time-stamped, so has a limited valid lifetime • At this point you can copy and paste the request into your browser and obtain the XML-formatted response.
HMAC • This figure comes from Wikipedia’s article on HMAC: Here’s how authentication happens in Amazon Web Services http://docs.amazonwebservices.com/AWSECommerceService/latest/DG/RequestAuthenticationArticle.html
Your Exercise • Perform a REST query to Amazon’s Web Services in order do an item search for books that match a set of keywords relevant to your term paper assignment. • Get the resulting XML document and paste it into the XPath validator. • Perform the necessary XPath query to obtain just the ASINs from this XML document • Select one of the ASINs and perform the REST query for an Item Lookup on that book from Amazon Web Services • Get the resulting XML document and paste it into the XPath validator (this will be a document for a single book). • Perform the necessary XPath query to show all URLs associated with your selected book. • Your deliverables for this exercise (to be turned in with your assignment): A Word document showing the REST and XPath queries themselves, along with screen images of the results for each of these.