Using Amazon Web Services AWS Amazon Web Services
Using Amazon Web Services (AWS)
Amazon Web Services (AWS) n n n A set of tools for providing remote access to Amazon product information to thirdparty 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 n n 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 n n 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 n n In addition to Access Keys, you also need to sign up as an Amazon Associate. Go to this site and follow the instructinos: n n https: //affiliate-program. amazon. com/ At this point you are ready to start using the Product API!
Amazon. Com’s Product Advertising API n n http: //docs. amazonwebservices. com/AWSECom merce. Service/latest/DG/Welcome. html In particular, look at: n n n Programming Guide (especially Visual Introduction and Requests – REST) API Reference Pay special attention to these two operations: n n Item. Search – retrieve a list of products matching a keyword search Item. Lookup – retrieve the details for a selected product
Using Amazon’s Signed Request Helper Page to Generate Requests n n You can go to this site to see how your public and private keys are used to turn UNSIGNED requests into SIGNED requests: http: //associatesamazon. s 3. amazonaws. com/signedrequests/helper/index. html
How Signed Request Helper Works n n n 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 Associate. Tag. 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. n n 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 n This figure comes from Wikipedia’s article on HMAC: Here’s how authentication happens in Amazon Web Services http: //docs. amazonwebservices. com/AWSECommerce. Service/latest/DG/Request Authentication. Article. html
Your Exercise 1. 2. 3. 4. 5. 6. n 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.
- Slides: 10