SignatureDoesNotMatch in Amazon API

I use the Amazon API and get this error when updating my stock from my database to the Amazon website:

Caught Exception: Internal Error
Response Status Code: 0
Error Code:
Error Type:
Request ID:
XML:

I read this thread (amazonsellercommunity. Com / forums / thread.jspa? MessageID = 2194823) and then get an explanation of the error:

<Error><Type>Sender</Type><Code>SignatureDoesNotMatch</Code><Message>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.</Message><Detail/></Error>

So, I thought my MARKETPLACE_ID, MERCHANT_ID, AWS_ACCESS_KEY_ID or AWS_SECRET_ACCESS_KEY might be wrong. But I checked, and this data is correct.

Actually, I don’t understand why this error occurs ... Previously, it worked perfectly, and after a couple of days it just collapsed. And I do not change anything in my code. Strange, isn't it?

Edit:

Here is my section code for the signature.

define ('DATE_FORMAT', 'Y-m-d\TH:i:s\Z');
define('AWS_ACCESS_KEY_ID', 'ABC...'); // My AWS Access Key Id (20 characters)
define('AWS_SECRET_ACCESS_KEY', 'ABCDEF...'); // My AWS Secret Access Key (40 characters)
define('APPLICATION_NAME', 'MyCompany_AmazonMWS');
define('APPLICATION_VERSION', '0.0.1');
define ('MERCHANT_ID', 'XXXXXXX'); // My Merchant ID
define ('MARKETPLACE_ID', 'XXXXXXX'); // My Marketplace ID

$config = array (
'ServiceURL' => "https://mws.amazonservices.fr",
'ProxyHost' => null,
'ProxyPort' => -1,
'MaxErrorRetry' => 3,
);

$service = new MarketplaceWebService_Client(
AWS_ACCESS_KEY_ID,
AWS_SECRET_ACCESS_KEY,
$config,
APPLICATION_NAME,
APPLICATION_VERSION
);

$parameters = array (
'Marketplace' => MARKETPLACE_ID,
'Merchant' => MERCHANT_ID,
'FeedType' => '_POST_INVENTORY_AVAILABILITY_DATA_',
'FeedContent' => $feedHandle,
'PurgeAndReplace' => false,
'ContentMd5' => base64_encode(md5(stream_get_contents($feedHandle), true)),
);

// and then I do this:

$request = new MarketplaceWebService_Model_SubmitFeedRequest($parameters);
invokeSubmitFeed($service, $request);

If you want to see some parts of my code, just ask.

Thanks in advance.

+5
3

, API Amazon / ( ). , ​​/.

+2

, , - URL-. , ( ) . , .

+1

( Ubuntu 14.04) ntpdate:

, :

apt-get install ntpdate 

:

ntpdate ntp.ubuntu.com
0

All Articles