I can't able to send the Text messages using Amazon Simple Notification Services(SNS). I have tried with API and Amazon Console. Both are not working. Please help me to solve the issues.
I am using Amazon Free plan account.
Amazon Sns support two diffrent type of messages
Promotions message
Transaction message
If your mobile register do not disturb or many service provider not allowed promotions messages like Verizon
Map<String, MessageAttributeValue> smsAttributes =
new HashMap<String,MessageAttributeValue>();
smsAttributes.put("AWS.SNS.SMS.SMSType",new
MessageAttributeValue().withStringValue("Transactional").withDataType("String"))
To discover why an SMS message was not sent, you can enable logging in CloudWatch Logs.
From Viewing Amazon CloudWatch metrics and logs for SMS deliveries - Amazon Simple Notification Service:
You can collect information about successful and unsuccessful SMS message deliveries by enabling Amazon SNS to write to Amazon CloudWatch Logs. For each SMS message that you send, Amazon SNS will write a log that includes the message price, the success or failure status, the reason for failure (if the message failed), the message dwell time, and other information.
I did this recently to discover why my SMS was not successful. The message said that my carrier refused the message. I discovered that this was because I was using a Custom Sender ID. Once I removed that setting, I could successfully send SMS messages.
Related
Im using AWS Lambda for sending emails by Amazon SES.
Each time that the request send_email succeeds I got the message id like confirmation.
But now, I want to use somehow this messageId. For example to know if this message concretelly get delivered or bounced.
CloudWatch offers me metrics, with the number of delivered or bounced messages but I want to look throught each one.
¿Is there any statement that allows to know the state of a message by id?
Due to the asynchronous nature of SMTP and how mails are being routed, you can't have this information immediately when sending an e-mail (via SES or otherwise).
However, AWS provides a feedback system which notifies an SNS topic when a message is delivered, bounced, or a complaint was received.
While the documentation is very detailed, the general idea is that you subscribe your own lambda(s) to the configured SNS topic(s) and you can then handle these events as you see fit (i.e. persist data on DynamoDB, call your unsubscribe API and so on).
On AWS I'm trying to create a cloudwatch alarm that sends a notification to a sns topic that in turn triggers a lambda function that is subscribed to the topic, but have run into a bit of a snag in which my lambda is never triggered. I've followed several tutorials on how to do this, I've manually tested the sns -lambda connection and this is working as is attaching the notification trigger onto cloudwatch.
I've done this all through cloudformation.
I have also tried to configure it manually from the cloudwatch console and then noticed something strange. Underneath the Send a notification to select box as shown in the image below, there is a message which says Only email lists for this account are available. So I'm guessing from that, that somewhere in this account, there is a weird setting that needs to be changed?
Updated answer:
Is the CloudWatch alarm actually in the "Alarm" state? Can you add 2 more notifications to be triggered by the "OK" and "Insufficient data" state respectively?
by reading the original post, SNS should have the right permission to invoke the Lambda function.
previous answer:
That is a general message, it has nothing to do with your SNS topic settings. I reckon it's meant to say only emails opt-in to that SNS topic will get emails.
Q: How does Amazon SNS validate a subscription request to ensure that notifications will not be sent to users as spam?
As part of the subscription registration, Amazon SNS will ensure that notifications are only sent to valid, registered subscribers/end-points. To prevent spam and ensure that a subscriber end-point is really interested in receiving notifications from a particular topic, Amazon SNS requires an explicit opt-in from subscribers using a 2-part handshake:
i. When a user first calls the Subscribe API and subscribes an end-point, Amazon SNS will send a confirmation message to the specified end-point.
ii. On receiving the confirmation message at the end-point, the subscriber should confirm the subscription request by sending a valid response. Only then will Amazon SNS consider the subscription request to be valid. If there is no response to the challenge, Amazon SNS will not send any notifications to that end-point. The exact mechanism of confirming the subscription varies by the transport protocol selected:
For HTTP/HTTPS notifications, Amazon SNS will first POST the confirmation message (containing a token) to the specified URL. The application monitoring the URL will have to call the ConfirmSubscription API with the token included token.
For Email and Email-JSON notifications, Amazon SNS will send an email to the specified address containing an embedded link. The user will need to click on the embedded link to confirm the subscription request.
For SQS notifications, Amazon SNS will enqueue a challenge message containing a token to the specified queue. The application monitoring the queue will have to call the ConfirmSubscription API with the token.
Note: The explicit “opt-in” steps described above are not required for the specific case where you subscribe your Amazon SQS queue to your Amazon SNS topic – and both are “owned” by the same AWS account.
We were using Amazon SNS to send SMS to our end-user. But now, we also need to sent our end users voice messages over landline.
Is it something feasible with Amazon SNS?
As far as i know, we are unable to send voice message through AWS SNS.
But you might be interested in Amazon pinpoint which allows you to send voice messages through that api, check here for pricing and to get started
I have requested a dedicated long code. But Whenever I send SMS to this Dedicated long code with Keywords, nothing is happening. I am not receiving any automated response messages (Response messages setup in the AWS Pinpoint Console). The dedicated number is for INDIA and region is AWS MUMBAI REGION.
I have also created SNS which is not at all getting triggered for incoming SMS for this dedicated number. I will provide additional details, if wanted. Please guide me to debug this issue.
I am trying to send messages using Amazon SNS but it's showing atypical behavior. It sends messages to some of the numbers while may or may not to others.
import boto3
client = boto3.client('sns', .....)
client.publish(PhoneNumber, Message)
I am using the publish API to directly send SMS for OTPs without using Topics. Is there a way I can get the delivery status for them? Would region/DND affect the delivery. This is for Indian numbers. I am using Transactional messages for the same.
On the console there is 'Text Messaging Preferences'. One needs to set up, IAM role for CloudWatch Logs access and Report Storage bucket. Once they are set up, Amazon will start storing logs in CloudWatch. Once done it will start showing delivery rates and status in the console UI and detailed logs in CloudWatch.
There are multitudes of reason for which delivery may fail. It lists out all on them. DND can also affect the delivery even if message type is transactional.
Also there is a availalble API to query these logs accordingly.