I am trying to find whether there is a way to opt out a phone number from AWS SNS programatically? I could find provisions
- to opt in an opted out phone number,
- list all opted out phone numbers, and
- whether a phone number is opted out or not.
But I couldn’t find anywhere on how to opt out a phone number programatically.
Kindly assist me with this issue.
3
Answers
I couldn't find any programmatically related solution. But I found a command line solution.
From CheckIfPhoneNumberIsOptedOut – Amazon Simple Notification Service:
That answers #1 and #3.
I could not find an API call that specifically lists opted-out numbers, but you could iterate through the subscribers on a topic and call
CheckIfPhoneNumberIsOptedOut()
to discover the status.Is there a particular use case where you need to programmatically opt out users from receiving SMS notifications? Typically, the user would themselves control this by replying "STOP" to a SMS they received.