andrewpuch / aws-ses-node-js-examples

Tutorial on using the AWS SES API to generate emails with attachments, create/list/delete verified senders. We will be using NodeJS as our primary language but it can be done using any language the AWS SDK supports.
https://www.youtube.com/watch?v=0NT8KRXRFG8
100 stars 58 forks source link

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. #5

Open sramesh8391 opened 5 years ago

sramesh8391 commented 5 years ago

I tried your code in my API it shows some error like this

{
    "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.",
    "code": "SignatureDoesNotMatch",
    "time": "2019-03-26T09:17:35.688Z",
    "requestId": "fe4e7d29-4fa7-11e9-bc9c-73fcff5b59b9",
    "statusCode": 403,
    "retryable": false,
    "retryDelay": 82.02929132453885
}

This is my code

var AWS = require('aws-sdk'); //Email config
var ses = new AWS.SES();
exports.verifyEmail = (req, res) =>{
  var email   = "ramesh@gmail.com";
  var params = {
      EmailAddress: email
  };
  ses.verifyEmailAddress(params, (err, data) =>{
      if(err) {
          res.send(err);
      } 
      else {
          res.send(data);
      } 
  });
}