Unable to add sender ID to AWS SNS text messages - amazon-web-services

I live in India and I have this requirement where I need to change the default sender Id of text messages sent via AWS SNS to the one that is registered for our organization with TRAI. We are trying to send SMS text messages to customers with Indian mobile numbers. I tried passing TemplateID and EntityId that was issued to us by our provider on the AWS console to manually test things out by unfortunately, whenever I receive text message on my mobile, the sender name still shows a random number assigned by AWS and not the sender id that I configured. I also made sure that the template message approved by TRAI is exactly the same but it did not work either. There are no error logs on AWS either because the message was successfully delivered. Its just that the sender id is not the one that I had configured it to be.
Any help on this topic would be much appreciated. Thanks in advance!
P.S. We registered our template on JIO which is a Telecom provider here in India.

You can't use AWS SNS for this. You have to use AWS Pinpoint if you want to use your specific number. With Pinpoint you can also use short-codes and long-codes and can also configure your messages to be promotional or transactional. You can set your sender id in AWS pinpoint as well. Check the documentation below on how to do that.
https://docs.aws.amazon.com/pinpoint/latest/userguide/channels-sms-awssupport-sender-id.html
It doesn't matter if you have any registration with any telco providers as AWS will use it's own infra to send the messages. So you either have to use 100% AWS solution or 100% telco provider services. You can't mix and match both for SMS sending use-case.
UPDATE:
Well SNS and Pinpoint are 2 different services for 2 different use cases. SNS is only for "notifications" and Pinpoint is like a communication service.
As far as sender-id in SNS is concerned, some countries require it as a hard requirement. You can read more about it in the documentation below:
https://docs.aws.amazon.com/sns/latest/dg/channels-sms-awssupport-sender-id.html

AWS SNS does support using sender IDs together with template and entity IDs for targeting India. If you follow the instructions at https://docs.aws.amazon.com/sns/latest/dg/channels-sms-senderid-india.html, you'll be able to do this.

Related

Why Amazon SNS service doesn't let me choose SMS subscription protocol?

I'm trying to send some SMS using the SNS services from Amazon, I'm following the tutorial available at https://docs.aws.amazon.com/sns/latest/dg/sms_publish-to-topic.html however AWS won't let me choose the SMS as a valid protocol, it only appears the SQS choice:
I've already set up my phone number to SMS sandbox and was able to publish a SMS message directly, following the tutorial: https://docs.aws.amazon.com/sns/latest/dg/sms_publish-to-phone.html#sms_publish_console
Anyone knows why this SMS protocol isn't available on AWS SNS service?
I've just found out that it was because I set my topic as FIFO instead of Standard...
If anyone runs on the same insane and silly mistake, please pay attention on that before going mad under google searching for this.
So using FIFO wont allow you use SMS as a Valid protocol? is there any other thing you did aside? changing from FIFO?

AWS SNS text message publishing not working

I'm trying to send an SMS(Text message) to a specific mobile number(IN : India, FROM : India) from the AWS management console. I have tried several times, from several regions but none of the messages has been delivered but it shows
SMS message published to phone number +91xxxxx successfully.
but the delivery statistics show that the messages have been failed.
Note: I'm using a root user account.
I'm new to AWS.
Any help will be really helpful.
there are special requirements when sending messages to recipients in India. Verify if you are using message type as Transactional. Because Promotional might be blocked on default settings.
https://docs.aws.amazon.com/sns/latest/dg/channels-sms-senderid-india.html
you will need to adhere to it before using AWS SNS in India.

AWS - Sending SMS without subscription

I am working on an app on AWS that needs to send text messages to customers. At times, the app just needs to send a single text message (AWS Transactional SMS may help here), at times it may need to text different groups of people (AWS doesn't seem to have a solution for this use case). It all depends on what the user is doing on the app.
I have explored the possibility of using SNS, but it requires users to be subscribed to a topic, which doesn't work for my use case. I have explored the possibility of using AWS Pinpoint, but it also doesn't seem to apply to my use case. I could use Twilio, but I would prefer to stay within AWS (Additionally, Twilio runs on AWS)
What is the best way to send text messages in the USA through AWS that doesn't require subscription to a topic?
If someone seeking for the answer of this Qn:
You can send SMS in 2 ways in AWS SNS.
Subscribe to a topic that is created in AWS SNS and send sms to all those numbers who had the subscription
Send SMS directly to a mobile number
What you need is the 2nd one.
I will demonstrate here how to do that with Ruby language.
Install the gem aws sns:
gem install aws-sdk-sns
require 'aws-sdk-sns'
1.Set SNS client
#sns_client = Aws::SNS::Client.new(
region: ENV['AWS_SNS_REGION'],
access_key_id: ENV['AWS_SNS_ACCESS_KEY'],
secret_access_key: ENV['AWS_SNS_SECRET_KEY']
)
2.Set SNS client attributes
#sns_client.set_sms_attributes({
attributes: {
'DefaultSenderID' => SENDER_ID,
'DefaultSMSType' => SMS_TYPE
}
})
3.Publish SMS
otp = (1000..9999).to_a.sample
#sns_client.publish({
phone_number: #mobile_no,
message: "#{OTM_MSG} #{otp}"
})
thats it!
OTM_MSG: ‘Your message comes here’
SMS_TYPE : ‘Transactional’ or ‘Promotional’
If you want to send OTP / bank transactions, then it is ‘Transactional’. Else if you want to send some promotional sms of your product then it is ‘Promotional’
SENDER_ID: is the sender id that you have already registered if you want to use your own sender id.
If you don't have sender id skip the step 2 - Set SNS client attributes
AWS_SNS_REGION, AWS_SNS_ACCESS_KEY, AWS_SNS_SECRET_KEY - are the credentials of your AWS account from where you would like to use SNS.
See the AWS documentation for this here:
https://docs.aws.amazon.com/sns/latest/dg/sms_publish-to-phone.html
It also provides code for Java language.
If you want to know more I have written an article here:
https://railsdrop.com/2021/03/04/aws-sns-how-to-send-sms/
Use the Publish action from the SNS service to send a text to a single phone without a topic. You could repeatedly call Publish to send texts to multiple phones.
https://docs.aws.amazon.com/sns/latest/dg/sms_publish-to-phone.html
Use the CreateTopic, Subscribe, and Publish actions from the SNS service to send a text to a multiple phones at once (uses a Topic).
https://docs.aws.amazon.com/sns/latest/dg/sms_publish-to-topic.html

Can we save client SMS responses in AWS Pinpoint's 2-way SMS?

I know that Amazon Pinpoint enables 2-way SMS, but I was wondering whether it was possible to save the message that the client sends. I'm finding myself going down the AWS rabbit-hole a bit, but I was wondering if anyone has any recommendations as to what AWS services could hold onto response data.
Just to clarify, I understand that Pinpoint allows us to return automated messages when the client passes a keyword. I am also aware that we can create user segments to save user attributes, I am moreso inquiring whether there is a way to stream user responses (that are not keywords) to another service or topic. Thank you!
An overview of Amazon Pinpoint two-way messaging can be summarized as per the above sample architecture.
You can capture the incoming messages from your users using the SNS topic you would have created when activating Pinpoint two-way messaging i.e When your users reply to your SMS message using the long code number, Amazon Pinpoint sends a JSON payload to the Amazon SNS topic that you designated. As a developer you handle these incoming messages by adding subscriptions to this SNS topic. The supported subscriptions include SQS, Lambda, email, HTTPS endpoint or SMS.
A sample JSON payload that your SNS topic subscriptions would receive would resemble the following :
{
"originationNumber":"+27155550000",
"destinationNumber":"+2722255511111",
"messageKeyword":"START",
"messageBody":"Hello World from Amazon Pinpoint",
"inboundMessageId":"cae173d2-66b9-564c-8309-66b9",
"previousPublishedMessageId":"wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY"
}
Hope this Helps!

Amazon Pinpoint vs. Amazon SES/SMS

I would like to send a verification code to a specific user (only one) via email or text message. I have successfully done so through Amazon SES but I have not attempted through Amazon SMS yet. I have found myself going down the rabbit hole of investigating AWS Pinpoint.
It seems to me Pinpoint is meant for mass user messaging (text/email) rather than one-of individual messaging. I'm hoping I gathered that correctly.
My question, is there an advantage/disadvantage of using Pinpoint over Amazon SES and SMS for my use case?
This may be addressed by the Pinpoint FAQ
Q: I already use Amazon SNS or Amazon SES. What do I gain by switching
to Amazon Pinpoint?
In typical Amazon SNS and Amazon SES use cases, you have to set up
your application to manage each message's audience, content, and
delivery schedule. These same features are built in to Amazon
Pinpoint. With Amazon Pinpoint, you can create message templates,
delivery schedules, highly-targeted segments, and full campaigns.
Pinpoint also appears to be able to push notifications to users through the users preferred contact mechanism. This means that you are not limited to SMS and you reach your users with activation codes through the means they want to be reached. It also allows two-way communication.
The Pinpoint homepage also says:
You can send direct messages—such as order confirmations, welcome
messages, and one-time passwords—using the console or the Amazon
Pinpoint REST API. You can also use the API to build custom
applications that deliver campaign and transactional messages across
multiple channels.
This suggest it is suitable for your uses, though it has additional mass-communication features you do not currently need.
In addition to above points mentioned by #Freiheit you can send and receive SMS messages through Amazon Pinpoint. This will help you to track user response and create surveys, reviews and quiz like scenarios.
Check this AWS Documentation link