Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

137
Views
Getting success response but SMS not delivered [ AWS SNS ]

I try to send SMS(Text message) to a specific mobile number(MA : Morocco, FROM : Morocco) using AWS SNS service using nodeJs I get a success and the data looks like:

{"MessageID":"ea4cf.."}

However, the SMS does not get delivered.

Here is the code:

router.post('/send-text', (req, res) => {

   var dynamoDBConfiguration = { 
    apiVersion: '2010-03-31',
     accessKeyId: 'A...',
     secretAccessKey: '...',
     region: 'eu-west-3'
    };


AWS.config.update(dynamoDBConfiguration);

// Create publish parameters
var params = {
  Message: req.body.message,
  PhoneNumber: '+' + req.body.number,

  MessageAttributes: {
    
      'AWS.SNS.SMS.SenderID': {
          'DataType': 'String',
          'StringValue': req.body.subject,
          
      }
  }
};
// Create promise and SNS service object
  var publishTextPromise = new AWS.SNS({ apiVersion: '2010-03-31' }).publish(params).promise();

  publishTextPromise.then(
    function (data) {
      res.end(JSON.stringify({ MessageID: data.MessageId }));
    }).catch(
      function (err) {
        res.end(JSON.stringify({ Error: err }));
      });
about 4 years ago · Santiago Gelvez
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!