skip to Main Content

I am trying to find whether there is a way to opt out a phone number from AWS SNS programatically? I could find provisions

  1. to opt in an opted out phone number,
  2. list all opted out phone numbers, and
  3. 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.

enter image description here

3

Answers


  1. Chosen as BEST ANSWER

    I couldn't find any programmatically related solution. But I found a command line solution.

    aws pinpoint-sms-voice-v2 put-opted-out-number --opt-out-list-name Default --opted-out-number +61444444444
    

  2. From CheckIfPhoneNumberIsOptedOut – Amazon Simple Notification Service:

    Accepts a phone number and indicates whether the phone holder has opted out of receiving SMS messages from your AWS account. You cannot send SMS messages to a number that is opted out.

    To resume sending messages, you can opt in the number by using the OptInPhoneNumber action.

    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.

    Login or Signup to reply.
  3. 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.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search