Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Amazon SNS - Sending SMS, delivery status

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.

like image 521
garg10may Avatar asked Jun 21 '17 06:06

garg10may


1 Answers

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. enter image description here

like image 110
garg10may Avatar answered Oct 14 '22 15:10

garg10may