<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Digicorp &#187; Amazon</title>
	<atom:link href="http://dev.digi-corp.com/category/amazon/feed/" rel="self" type="application/rss+xml" />
	<link>http://dev.digi-corp.com</link>
	<description>&#62;&#62; Developer Blog</description>
	<lastBuildDate>Wed, 22 Jun 2011 14:13:24 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>How to integrate Amazon Web Services in your Web Application?</title>
		<link>http://dev.digi-corp.com/2009/09/how-to-integrate-amazon-web-services-in-your-web-application/</link>
		<comments>http://dev.digi-corp.com/2009/09/how-to-integrate-amazon-web-services-in-your-web-application/#comments</comments>
		<pubDate>Tue, 01 Sep 2009 10:48:42 +0000</pubDate>
		<dc:creator>archit.patel</dc:creator>
				<category><![CDATA[Amazon]]></category>
		<category><![CDATA[Amazon Web Services]]></category>
		<category><![CDATA[AWS]]></category>

		<guid isPermaLink="false">http://dev.digi-corp.com/?p=1293</guid>
		<description><![CDATA[What is Amazon Web Services (AWS)? Amazon Web Services (AWS) has provided companies of all sizes with an infrastructure web services platform in the cloud. With AWS you can requisition compute power, storage, and other services–gaining access to a suite of elastic IT infrastructure services as your business demands them. Amazon Web Services provides a [...]]]></description>
			<content:encoded><![CDATA[<p><strong>What is Amazon Web Services (AWS)?</strong><br />
Amazon Web Services (AWS) has provided companies of all sizes with an infrastructure web services platform in the cloud. With AWS you can requisition compute power, storage, and other services–gaining access to a suite of elastic IT infrastructure services as your business demands them.</p>
<p>Amazon Web Services provides a number of benefits for IT organizations which are:cost effective,dependable,flexible.</p>
<p><strong>How  to integrate amazon in your site?</strong><br />
-&gt; You need to get an access_key_id.<br />
-&gt; Authorized your Product API or Access_key.</p>
<p><strong>How to get an access_key_id?</strong><br />
To get an access_key you have to create aws account from the below link:<br />
<a href="https://aws-portal.amazon.com/gp/aws/developer/registration/index.html">https://aws-portal.amazon.com/gp/aws/developer/registration/index.html</a></p>
<p>After submitting the form you will get a mail from amazon. In that mail you will find a link link:<br />
<a href="https://aws-portal.amazon.com/gp/aws/developer/account/index.html?ie=UTF8&amp;action=access-key">https://aws-portal.amazon.com/gp/aws/developer/account/index.html?ie=UTF8&amp;action=access-key</a></p>
<p>From this link you will get your access key and private key. Store your public key(access key) and private key(secret key) in your config file. Using this access_key you can access all amazon  books and its details  in your page.</p>
<p><strong>How to make your Product API or Access_key Authorized?</strong><br />
You need to create a two demo files and one function file using below code</p>
<p style="padding-left: 30px;">1) Function file-  aws_signature.php<br />
2) Example file- example1.php<br />
3) Example file- example2.php</p>
<p><strong>1)Make one file named as aws_signature.php</strong><br />
&lt;?php<br />
function aws_signature($location, $params, $public_key, $private_key)<br />
{<br />
$private_key=&#8221;your secret key&#8221;;<br />
$method = &#8220;GET&#8221;;<br />
$hostname = &#8220;ecs.amazonaws.&#8221;.$location;<br />
$uri = &#8220;/onca/xml&#8221;;</p>
<p>// additional parameters<br />
$params["Service"] = &#8220;AWSECommerceService&#8221;;<br />
$params["AWSAccessKeyId"] = $public_key;</p>
<p>// GMT timestamp<br />
$params["Timestamp"] = gmdate(&#8220;Y-m-d\TH:i:s\Z&#8221;);</p>
<p>// API version<br />
$params["Version"] = &#8220;2009-03-31&#8243;;</p>
<p>// sort the parameters<br />
ksort($params);</p>
<p>// create the query<br />
$query = array();<br />
foreach ($params as $param=&gt;$value)<br />
{<br />
$param = str_replace(&#8220;%7E&#8221;, &#8220;~&#8221;, rawurlencode($param));<br />
$value = str_replace(&#8220;%7E&#8221;, &#8220;~&#8221;, rawurlencode($value));<br />
$query[] = $param.&#8221;=&#8221;.$value;<br />
}<br />
$query = implode(&#8220;&amp;&#8221;, $query);<br />
$string_to_sign = $method.&#8221;\n&#8221;.$hostname.&#8221;\n&#8221;.$url.&#8221;\n&#8221;.$query;<br />
$signature = base64_encode(hash_hmac(&#8220;sha256&#8243;, $string_to_sign, $private_key, True));</p>
<p>// create request<br />
$request = &#8220;http://&#8221;.$hostname.$url.&#8221;?&#8221;.$query.&#8221;&amp;Signature=&#8221;.$signature;<br />
// do request<br />
$request=str_replace(&#8221; &#8220;,&#8221;+&#8221;,$request);<br />
$response = @file_get_contents($request);<br />
if ($response === False)<br />
{<br />
return False;<br />
}<br />
else<br />
{<br />
// parse XML<br />
$parsed_xml = simplexml_load_string($response);<br />
if ($parsed_xml === False)<br />
{<br />
return False; // no xml<br />
}<br />
else<br />
{<br />
return $parsed_xml;<br />
}<br />
}<br />
//Note:You can use  $parsed_xml as you requested array.You will get all the records from this array.<br />
?&gt;</p>
<p><strong>2)Make one file named as example1.php</strong><br />
//To get the data for particular ISBN.<br />
&lt;?php<br />
include(‘aws_signature.php’);<br />
$isbn=&#8221;your book isbn value&#8221;;<br />
include(&#8216;aws_signature.php&#8217;);<br />
$public_key = &#8220;your public key&#8221;;<br />
$private_key = &#8220;your private key&#8221;;</p>
<p>//You can select response group from this site:http://docs.amazonwebservices.com/_<br />
AWSECommerceService/2008-03-03    /DG/index.html?ItemLookup.html</p>
<p>//Operation is ItemLookup for Particular item page.<br />
$parsed_xml = aws_signature(&#8220;com&#8221;,  array(&#8220;Operation&#8221;=&gt;&#8221;ItemLookup&#8221;,&#8221;ResponseGroup&#8221;=&gt;&#8221;VariationSummary,_<br />
SalesRank,Medium,Reviews,ItemAttributes,Offers,Images&#8221;,&#8221;ItemId&#8221;=&gt;$isbn),   $public_key, $private_key);<br />
?&gt;</p>
<p><strong>3)Make one file named as example2.php</strong><br />
//To get all books from amazon without knowing any book isbn value.<br />
&lt;?php<br />
include(&#8216;aws_signature.php&#8217;);<br />
$public_key = &#8220;YOur public key&#8221;;<br />
$private_key = &#8220;your private key&#8221;;<br />
$new_keyword=&#8221;Your keyword&#8221;;</p>
<p>//Operation is ItemSearch for all books.<br />
$parsed_xml = aws_signature(&#8220;com&#8221;,   array(&#8220;Operation&#8221;=&gt;&#8221;ItemSearch&#8221;,&#8221;SearchIndex&#8221;=&gt;&#8221;Books&#8221;,&#8221;ResponseGroup&#8221;=&gt;&#8221;VariationSummary,_<br />
SalesRank,Medium,Reviews,ItemAttributes,Offers,Images&#8221;,&#8221;Keywords&#8221;=&gt;$new_keyword),  $public_key, $private_key);<br />
?&gt;</p>
]]></content:encoded>
			<wfw:commentRss>http://dev.digi-corp.com/2009/09/how-to-integrate-amazon-web-services-in-your-web-application/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

