Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Signature issue when trynig to submit feed #4

Open
LongneckJohn opened this issue May 11, 2017 · 3 comments
Open

Signature issue when trynig to submit feed #4

LongneckJohn opened this issue May 11, 2017 · 3 comments

Comments

@LongneckJohn
Copy link

I need some help. Here is my code. I am able to use the package for orders and reports an am now trying to use feed to add products. Any ideas what I am doing wrong or is this a bug?


let mws = require('mws-simple')({
accessKeyId: ourAmazonController.awsAccessKeyId,
secretAccessKey: ourAmazonController.secret,
merchantId: ourAmazonController.sellerId
});

var ourFeedContent = `
                  <?xml version="1.0" ?>
                    <AmazonEnvelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="amzn-envelope.xsd">
                      <Header>
                        <DocumentVersion>1.01</DocumentVersion>
                        <MerchantIdentifier>M_SELLER_354577</MerchantIdentifier>
                      </Header>
                      <MessageType>Product</MessageType>
                      <PurgeAndReplace>true</PurgeAndReplace>
                      <Message>
                        <MessageID>1</MessageID>
                        <OperationType>Update</OperationType>
                        <Product>
                          <SKU>JDLtestJDL</SKU>
                          <ProductTaxCode>A_GEN_TAX</ProductTaxCode>
                          <LaunchDate>2025-07-26T00:00:01</LaunchDate>
                          <DescriptionData>
                            <Title>Lyric 500 tc Queen Flat Sheet, Ivory</Title>
                            <Brand>Test Brand</Brand>
                            <Description>
                              This is a test product and is not for purchase.
                            </Description>
                            <BulletPoint>test bullet 1</BulletPoint>
                            <BulletPoint>test bullet 2</BulletPoint>
                            <Manufacturer>test manufacturer</Manufacturer>
                            <SearchTerms>test search term</SearchTerms>
                            <ItemType>test item type</ItemType>
                            <IsGiftWrapAvailable>false</IsGiftWrapAvailable>
                            <IsGiftMessageAvailable>false</IsGiftMessageAvailable>
                          </DescriptionData>
                          <ProductData>
                            <Home>
                              <Parentage>variation-parent</Parentage>
                              <VariationData>
                                <VariationTheme>Size-Color</VariationTheme>
                              </VariationData>
                              <Material>cotton</Material>
                              <ThreadCount>500</ThreadCount>
                            </Home>
                          </ProductData>
                      </Product>
                    </Message>
                    <Message>
                  </AmazonEnvelope>
                  `
;

let submitFeed = {
  feedContent: ourFeedContent,
  query: {
    Action: 'SubmitFeed',
    FeedType: '_POST_PRODUCT_DATA_',
    'MarketplaceIdList.Id.1': ourAmazonController.marketplaceId,
    Version: '2009-01-01'
  }
};

mws.request(submitFeed, function(e, result) {
});


Future = Npm.require('fibers/future');
var myFuture = new Future();

mws.request(submitFeed, function(error, results) {
  if ( error ) {
    myFuture.return(error);
  } else {
    myFuture.return(results);
  }
  //consoleLogObject("results", results);

});

return myFuture.wait(); // wait for the mws http call to return

The above generates this response:
{
-"ErrorResponse": {
-"$": {
"xmlns": "http://mws.amazonaws.com/doc/2009-01-01/"
},
-"Error": [
-{
-"Type": [
"Sender"
],
-"Code": [
"SignatureDoesNotMatch"
],
-"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."
]
}
],
+"RequestID": [ … ]
}
}

@ebusinessdirect
Copy link
Owner

Got this, will check it out.

@jleiken
Copy link

jleiken commented Jul 3, 2017

+1 I'm having the same issue. I have two files using this package, one which is simple and just uses the package to explore the API. The other is much longer and among other packages. It's still working for me in the smaller file but not in the larger one. Calls were working for me in the larger one until today.

@jleiken
Copy link

jleiken commented Jul 10, 2017

Resolved. I wasn't including a CreatedAfter or CreatedBefore parameter.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants