By using AWS re:Post, you agree to the Terms of Use
/eCommerce/

Questions tagged with eCommerce

Sort by most recent
  • 1
  • 90 / page

Browse through the questions and answers listed below or filter and sort to narrow down your results.

Passing custom senderID and templateID for AWS SNS in India using NodeJS

So, I am trying to figure out the NodeJS Code for sending SMS to Indian mobile numbers using AWS SNS. I have gotten the code down to sending the SMS but I am not able to map the senderID or the templateID which I have gotten registered. The DLT Template ID has been registered with Airtel DLT Connect and even the entityID has been registered there. I am getting the SMS but with a random senderID, not the one I am assigning. The code snippet is below: ``` var AWS = require('aws-sdk'); var config = { AWS: { accessKeyId: "", secretAccessKey: "", region: "ap-south-1" } } AWS.config.update({ accessKeyId: config.AWS.accessKeyId, secretAccessKey: config.AWS.secretAccessKey, region: config.AWS.region }); var params = { Message: "Your verification code is 123345. This code is valid for 24 hours.", MessageStructure: 'string', PhoneNumber: '+91XXXXXXXXXX', MessageAttributes: { "AWS.SNS.SMS.SenderID": { DataType: 'String', StringValue: 'CustomSenderID' }, "AWS.SNS.SMS.SMSType": { DataType: 'String', StringValue: 'Transactional' }, "AWS.MM.SMS.EntityID": { DataType: 'String', StringValue: 'EntityID' }, "AWS.MM.SMS.TemplateId": { DataType: 'String', StringValue: 'TemplateID' } } }; var sns = new AWS.SNS(); sns.publish(params, function (err, data) { if (err) { console.log(err); } else { console.log(data); } }); ``` So, if I don't pass the EntityID and the templateID, I get the SMS but with a random numeric senderID. When I try to pass it in the example shown above, I get the below error: ``` ParameterValueInvalid: Message attribute names starting with 'AWS.' or 'Amazon.' are reserved for use by Amazon. at Request.extractError (D:\WORK\Agri10x\Development\Projects\dataserver\node_modules\aws-sdk\lib\protocol\query.js:50:29) at Request.callListeners (D:\WORK\Agri10x\Development\Projects\dataserver\node_modules\aws-sdk\lib\sequential_executor.js:106:20) at Request.emit (D:\WORK\Agri10x\Development\Projects\dataserver\node_modules\aws-sdk\lib\sequential_executor.js:78:10) at Request.emit (D:\WORK\Agri10x\Development\Projects\dataserver\node_modules\aws-sdk\lib\request.js:686:14) at Request.transition (D:\WORK\Agri10x\Development\Projects\dataserver\node_modules\aws-sdk\lib\request.js:22:10) at AcceptorStateMachine.runTo (D:\WORK\Agri10x\Development\Projects\dataserver\node_modules\aws-sdk\lib\state_machine.js:14:12) at D:\WORK\Agri10x\Development\Projects\dataserver\node_modules\aws-sdk\lib\state_machine.js:26:10 at Request.<anonymous> (D:\WORK\Agri10x\Development\Projects\dataserver\node_modules\aws-sdk\lib\request.js:38:9) at Request.<anonymous> (D:\WORK\Agri10x\Development\Projects\dataserver\node_modules\aws-sdk\lib\request.js:688:12) at Request.callListeners (D:\WORK\Agri10x\Development\Projects\dataserver\node_modules\aws-sdk\lib\sequential_executor.js:116:18) { code: 'ParameterValueInvalid', time: 2022-01-06T09:33:30.590Z, requestId: 'dc92b0a1-e561-5ae4-a32d-eaf15ccb3fea', statusCode: 400, retryable: false, retryDelay: 57.53422286102854 } ``` Any help would be appreciated! Thanks in advance!
0
answers
0
votes
9
views
asked 6 months ago
  • 1
  • 90 / page