Note that there are some explanatory texts on larger screens.

plurals
  1. POAmazon MWS Scratchpad API
    primarykey
    data
    text
    <p>I am trying to get Amazon MWS Scratchpad working, but it keeps giving me a message:</p> <blockquote> <p>The request signature we calculated does not match the signature you provided. Check your AWS Secret Access Key and signing method. Consult the service documentation for details.</p> </blockquote> <p>I was looking for similar topic out here, but nothing really helpful. So, here is code:</p> <pre><code>$params = array( 'AWSAccessKeyId' =&gt; AWS_ACCESS_KEY_ID, 'Action' =&gt; "GetLowestOfferListingsForASIN", 'SellerId' =&gt; MERCHANT_ID, 'SignatureMethod' =&gt; "HmacSHA256", 'SignatureVersion' =&gt; "2", 'Timestamp' =&gt; gmdate("Y-m-d\TH:i:s\Z", time()), 'Version' =&gt; "2011-10-01", 'MarketplaceId' =&gt; MARKETPLACE_ID, 'ItemCondition' =&gt; "new", 'ASINList.ASIN.1' =&gt; "B001T6OP32"); $url = array(); foreach($params as $key =&gt; $val){ $val = str_replace('%7E', '~', rawurlencode($val)); $url[] = $key . '=' . $val; } $uri = implode('&amp;', $url); $string_to_sign = 'POST'; $string_to_sign .= "\n"; $string_to_sign .= 'mws.amazonservices.co.uk' . "\n"; $string_to_sign .= '/Products/2011-10-01' . "\n"; $string_to_sign .= $uri; $signature = hash_hmac("sha256", $string_to_sign, AWS_SECRET_ACCESS_KEY, TRUE); $signature = base64_encode($signature); $signature = urlencode($signature); $signature = str_replace("%7E", "~", $signature); $url = 'https://mws.amazonservices.co.uk/'; $url .= 'Products/2011-10-01' . '?' . $uri . "&amp;Signature=" . $signature; </code></pre> <p>I bet that problem is with Signature, when I'm printing it with <code>print $signature</code> it always contains <code>%</code> symbols, and when I'm comparing with <a href="https://mws.amazonservices.co.uk/scratchpad/index.html" rel="nofollow">Amazon Scratchpad</a> Request Details page, <code>SHA 256 HMAC</code> field - there is none.</p> <p>Maby there is something I can't see? I was checking for spaces in Secret Access Key, it's looks okay.</p> <p>Many Thanks.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload