How to send an SMS with custom sender ID with Amazon SNS and Python and boto32019 Community Moderator ElectionMultiple Environment Support in AWS SNS SMSHow do I copy a file in Python?How can I safely create a nested directory in Python?How do I parse a string to a float or int in Python?How to get the current time in PythonHow can I make a time delay in Python?How to get the number of elements in a list in Python?How to concatenate two lists in Python?How to read a file line-by-line into a list?How to lowercase a string in Python?ERROR sending a SMS with Amazon SNS and Python and boto3

How do we create new idioms and use them in a novel?

Playing a 7-string guitar song on a 6-string guitar

Traveling to heavily polluted city, what practical measures can I take to minimize impact?

PTIJ: Who was the sixth set of priestly clothes for?

Converting from "matrix" data into "coordinate" data

School performs periodic password audits. Is my password compromised?

Why is there an extra space when I type "ls" on the Desktop?

Trocar background-image com delay via jQuery

Professor forcing me to attend a conference, I can't afford even with 50% funding

Can one live in the U.S. and not use a credit card?

Short scifi story where reproductive organs are converted to produce "materials", pregnant protagonist is "found fit" to be a mother

Is this Paypal Github SDK reference really a dangerous site?

How is it possible to drive VGA displays at such high pixel clock frequencies?

I can't die. Who am I?

Do Cubics always have one real root?

Is it possible to clone a polymorphic object without manually adding overridden clone method into each derived class in C++?

If nine coins are tossed, what is the probability that the number of heads is even?

How can I portion out frozen cookie dough?

How do spaceships determine each other's mass in space?

"If + would" conditional in present perfect tense

Use Mercury as quenching liquid for swords?

Can the Witch Sight warlock invocation see through the Mirror Image spell?

If sound is a longitudinal wave, why can we hear it if our ears aren't aligned with the propagation direction?

Giving a career talk in my old university, how prominently should I tell students my salary?



How to send an SMS with custom sender ID with Amazon SNS and Python and boto3



2019 Community Moderator ElectionMultiple Environment Support in AWS SNS SMSHow do I copy a file in Python?How can I safely create a nested directory in Python?How do I parse a string to a float or int in Python?How to get the current time in PythonHow can I make a time delay in Python?How to get the number of elements in a list in Python?How to concatenate two lists in Python?How to read a file line-by-line into a list?How to lowercase a string in Python?ERROR sending a SMS with Amazon SNS and Python and boto3










20















The documentation suggests to use message attributes for that but I can't seem to figure out what attribute name to use.



This works so far:



sns = boto3.client('sns', region_name='eu-west-1')

sns.publish(
PhoneNumber='+491701234567',
Message='hi there',
MessageAttributes=
'AWS.SNS.SMS.SenderID':
'DataType': 'String',
'StringValue': 'MySenderID'


)


The SMS is delivered but with some (random?) value in the sender id field. So it seems my setting of message attributes is silently ignored. What is the correct way to set a custom sender id?










share|improve this question






















  • What country is that phone number?

    – error2007s
    Jul 13 '16 at 15:30











  • @error2007s Germany

    – tgal
    Jul 14 '16 at 16:34











  • I have the same trouble trying to send message from the console. No matter what i write in Sender ID field i got NEXMO_SMS instead. Is it a bug?

    – Diligent Key Presser
    Nov 11 '16 at 8:09











  • As workaround you can set 'DefaultSenderID' <!-- language: python --> #!/usr/bin/env python import boto3 s = boto3.Session(profile_name='Godzilla') sns = s.client('sns') sns.set_sms_attributes( attributes= 'DefaultSenderID': 'Godzilla', ) response = sns.get_sms_attributes( attributes=[ 'DefaultSenderID', ] ) print(response)

    – tuxar
    Nov 30 '16 at 19:27
















20















The documentation suggests to use message attributes for that but I can't seem to figure out what attribute name to use.



This works so far:



sns = boto3.client('sns', region_name='eu-west-1')

sns.publish(
PhoneNumber='+491701234567',
Message='hi there',
MessageAttributes=
'AWS.SNS.SMS.SenderID':
'DataType': 'String',
'StringValue': 'MySenderID'


)


The SMS is delivered but with some (random?) value in the sender id field. So it seems my setting of message attributes is silently ignored. What is the correct way to set a custom sender id?










share|improve this question






















  • What country is that phone number?

    – error2007s
    Jul 13 '16 at 15:30











  • @error2007s Germany

    – tgal
    Jul 14 '16 at 16:34











  • I have the same trouble trying to send message from the console. No matter what i write in Sender ID field i got NEXMO_SMS instead. Is it a bug?

    – Diligent Key Presser
    Nov 11 '16 at 8:09











  • As workaround you can set 'DefaultSenderID' <!-- language: python --> #!/usr/bin/env python import boto3 s = boto3.Session(profile_name='Godzilla') sns = s.client('sns') sns.set_sms_attributes( attributes= 'DefaultSenderID': 'Godzilla', ) response = sns.get_sms_attributes( attributes=[ 'DefaultSenderID', ] ) print(response)

    – tuxar
    Nov 30 '16 at 19:27














20












20








20


5






The documentation suggests to use message attributes for that but I can't seem to figure out what attribute name to use.



This works so far:



sns = boto3.client('sns', region_name='eu-west-1')

sns.publish(
PhoneNumber='+491701234567',
Message='hi there',
MessageAttributes=
'AWS.SNS.SMS.SenderID':
'DataType': 'String',
'StringValue': 'MySenderID'


)


The SMS is delivered but with some (random?) value in the sender id field. So it seems my setting of message attributes is silently ignored. What is the correct way to set a custom sender id?










share|improve this question














The documentation suggests to use message attributes for that but I can't seem to figure out what attribute name to use.



This works so far:



sns = boto3.client('sns', region_name='eu-west-1')

sns.publish(
PhoneNumber='+491701234567',
Message='hi there',
MessageAttributes=
'AWS.SNS.SMS.SenderID':
'DataType': 'String',
'StringValue': 'MySenderID'


)


The SMS is delivered but with some (random?) value in the sender id field. So it seems my setting of message attributes is silently ignored. What is the correct way to set a custom sender id?







python amazon-web-services sms amazon-sns boto3






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Jul 13 '16 at 14:54









tgaltgal

20123




20123












  • What country is that phone number?

    – error2007s
    Jul 13 '16 at 15:30











  • @error2007s Germany

    – tgal
    Jul 14 '16 at 16:34











  • I have the same trouble trying to send message from the console. No matter what i write in Sender ID field i got NEXMO_SMS instead. Is it a bug?

    – Diligent Key Presser
    Nov 11 '16 at 8:09











  • As workaround you can set 'DefaultSenderID' <!-- language: python --> #!/usr/bin/env python import boto3 s = boto3.Session(profile_name='Godzilla') sns = s.client('sns') sns.set_sms_attributes( attributes= 'DefaultSenderID': 'Godzilla', ) response = sns.get_sms_attributes( attributes=[ 'DefaultSenderID', ] ) print(response)

    – tuxar
    Nov 30 '16 at 19:27


















  • What country is that phone number?

    – error2007s
    Jul 13 '16 at 15:30











  • @error2007s Germany

    – tgal
    Jul 14 '16 at 16:34











  • I have the same trouble trying to send message from the console. No matter what i write in Sender ID field i got NEXMO_SMS instead. Is it a bug?

    – Diligent Key Presser
    Nov 11 '16 at 8:09











  • As workaround you can set 'DefaultSenderID' <!-- language: python --> #!/usr/bin/env python import boto3 s = boto3.Session(profile_name='Godzilla') sns = s.client('sns') sns.set_sms_attributes( attributes= 'DefaultSenderID': 'Godzilla', ) response = sns.get_sms_attributes( attributes=[ 'DefaultSenderID', ] ) print(response)

    – tuxar
    Nov 30 '16 at 19:27

















What country is that phone number?

– error2007s
Jul 13 '16 at 15:30





What country is that phone number?

– error2007s
Jul 13 '16 at 15:30













@error2007s Germany

– tgal
Jul 14 '16 at 16:34





@error2007s Germany

– tgal
Jul 14 '16 at 16:34













I have the same trouble trying to send message from the console. No matter what i write in Sender ID field i got NEXMO_SMS instead. Is it a bug?

– Diligent Key Presser
Nov 11 '16 at 8:09





I have the same trouble trying to send message from the console. No matter what i write in Sender ID field i got NEXMO_SMS instead. Is it a bug?

– Diligent Key Presser
Nov 11 '16 at 8:09













As workaround you can set 'DefaultSenderID' <!-- language: python --> #!/usr/bin/env python import boto3 s = boto3.Session(profile_name='Godzilla') sns = s.client('sns') sns.set_sms_attributes( attributes= 'DefaultSenderID': 'Godzilla', ) response = sns.get_sms_attributes( attributes=[ 'DefaultSenderID', ] ) print(response)

– tuxar
Nov 30 '16 at 19:27






As workaround you can set 'DefaultSenderID' <!-- language: python --> #!/usr/bin/env python import boto3 s = boto3.Session(profile_name='Godzilla') sns = s.client('sns') sns.set_sms_attributes( attributes= 'DefaultSenderID': 'Godzilla', ) response = sns.get_sms_attributes( attributes=[ 'DefaultSenderID', ] ) print(response)

– tuxar
Nov 30 '16 at 19:27













2 Answers
2






active

oldest

votes


















1














Check if your destination country supports sender IDs



http://docs.aws.amazon.com/sns/latest/dg/sms_supported-countries.html






share|improve this answer






























    1














    As noted by Adam Owczarczyk, some countries don't allow you to transmit a sender ID in a text message. The API will take your number and replace it with a string in this case to allow your message to get delivered. Attempting to work around it usually just gets the number blacklisted. You can test this by entering a short descriptive string for your tester ID, and seeing if that gets through.






    share|improve this answer
























      Your Answer






      StackExchange.ifUsing("editor", function ()
      StackExchange.using("externalEditor", function ()
      StackExchange.using("snippets", function ()
      StackExchange.snippets.init();
      );
      );
      , "code-snippets");

      StackExchange.ready(function()
      var channelOptions =
      tags: "".split(" "),
      id: "1"
      ;
      initTagRenderer("".split(" "), "".split(" "), channelOptions);

      StackExchange.using("externalEditor", function()
      // Have to fire editor after snippets, if snippets enabled
      if (StackExchange.settings.snippets.snippetsEnabled)
      StackExchange.using("snippets", function()
      createEditor();
      );

      else
      createEditor();

      );

      function createEditor()
      StackExchange.prepareEditor(
      heartbeatType: 'answer',
      autoActivateHeartbeat: false,
      convertImagesToLinks: true,
      noModals: true,
      showLowRepImageUploadWarning: true,
      reputationToPostImages: 10,
      bindNavPrevention: true,
      postfix: "",
      imageUploader:
      brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
      contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
      allowUrls: true
      ,
      onDemand: true,
      discardSelector: ".discard-answer"
      ,immediatelyShowMarkdownHelp:true
      );



      );













      draft saved

      draft discarded


















      StackExchange.ready(
      function ()
      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f38355151%2fhow-to-send-an-sms-with-custom-sender-id-with-amazon-sns-and-python-and-boto3%23new-answer', 'question_page');

      );

      Post as a guest















      Required, but never shown

























      2 Answers
      2






      active

      oldest

      votes








      2 Answers
      2






      active

      oldest

      votes









      active

      oldest

      votes






      active

      oldest

      votes









      1














      Check if your destination country supports sender IDs



      http://docs.aws.amazon.com/sns/latest/dg/sms_supported-countries.html






      share|improve this answer



























        1














        Check if your destination country supports sender IDs



        http://docs.aws.amazon.com/sns/latest/dg/sms_supported-countries.html






        share|improve this answer

























          1












          1








          1







          Check if your destination country supports sender IDs



          http://docs.aws.amazon.com/sns/latest/dg/sms_supported-countries.html






          share|improve this answer













          Check if your destination country supports sender IDs



          http://docs.aws.amazon.com/sns/latest/dg/sms_supported-countries.html







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Apr 26 '17 at 10:48









          Adam OwczarczykAdam Owczarczyk

          1,337717




          1,337717























              1














              As noted by Adam Owczarczyk, some countries don't allow you to transmit a sender ID in a text message. The API will take your number and replace it with a string in this case to allow your message to get delivered. Attempting to work around it usually just gets the number blacklisted. You can test this by entering a short descriptive string for your tester ID, and seeing if that gets through.






              share|improve this answer





























                1














                As noted by Adam Owczarczyk, some countries don't allow you to transmit a sender ID in a text message. The API will take your number and replace it with a string in this case to allow your message to get delivered. Attempting to work around it usually just gets the number blacklisted. You can test this by entering a short descriptive string for your tester ID, and seeing if that gets through.






                share|improve this answer



























                  1












                  1








                  1







                  As noted by Adam Owczarczyk, some countries don't allow you to transmit a sender ID in a text message. The API will take your number and replace it with a string in this case to allow your message to get delivered. Attempting to work around it usually just gets the number blacklisted. You can test this by entering a short descriptive string for your tester ID, and seeing if that gets through.






                  share|improve this answer















                  As noted by Adam Owczarczyk, some countries don't allow you to transmit a sender ID in a text message. The API will take your number and replace it with a string in this case to allow your message to get delivered. Attempting to work around it usually just gets the number blacklisted. You can test this by entering a short descriptive string for your tester ID, and seeing if that gets through.







                  share|improve this answer














                  share|improve this answer



                  share|improve this answer








                  edited Mar 6 at 23:54









                  Cody Gray

                  194k35380468




                  194k35380468










                  answered Mar 6 at 23:01









                  JaminaBeeJaminaBee

                  135




                  135



























                      draft saved

                      draft discarded
















































                      Thanks for contributing an answer to Stack Overflow!


                      • Please be sure to answer the question. Provide details and share your research!

                      But avoid


                      • Asking for help, clarification, or responding to other answers.

                      • Making statements based on opinion; back them up with references or personal experience.

                      To learn more, see our tips on writing great answers.




                      draft saved


                      draft discarded














                      StackExchange.ready(
                      function ()
                      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f38355151%2fhow-to-send-an-sms-with-custom-sender-id-with-amazon-sns-and-python-and-boto3%23new-answer', 'question_page');

                      );

                      Post as a guest















                      Required, but never shown





















































                      Required, but never shown














                      Required, but never shown












                      Required, but never shown







                      Required, but never shown

































                      Required, but never shown














                      Required, but never shown












                      Required, but never shown







                      Required, but never shown







                      Popular posts from this blog

                      Thal And Out Agency railway station See also References External links Navigation menuOfficial Web Site of Pakistan RailwaysArchivedOfficial Web Site of Pakistan Railwayseeexpanding ite

                      Understanding generators in Python2019 Community Moderator ElectionGenerator function not working pythonFor loop not executing two timesGenerators - Printing generated valuesWhy can a python generator only be used once?What exactly do generators do?What does the “yield” keyword do?What does “list comprehension” mean? How does it work and how can I use it?sklearn Kfold acces single fold instead of for loopIs a generator the callable? Which is the generator?Apply Border To Range Of Cells Using OpenpyxlCalling an external command in PythonWhat are metaclasses in Python?What is the difference between @staticmethod and @classmethod?Finding the index of an item given a list containing it in PythonDifference between append vs. extend list methods in PythonHow can I safely create a nested directory in Python?Does Python have a ternary conditional operator?Understanding slice notationUnderstanding Python super() with __init__() methodsDoes Python have a string 'contains' substring method?

                      How can I change the color of pagination dots of UIPageControl?How to change UIPageControl dotsIs there a way to change page indicator dots colorCustomize dot with image of UIPageControl at index 0 of UIPageControlNo visible @interface for 'NSObject<PageControlDelegate>' declares the selector 'pageControlPageDidChange:'How to change the color of pagination dots in UIPageControl with a different color per pagepagecontrol indicator custom image instead of DefaultChanging the colour of UIPageControl dots in MonoTouchpagecontrol selectable page visibility color?Alternative way to load ViewControllers on a UIPageControlHow to set only layer.border-color for UIpage control dots in swiftHow can I develop for iPhone using a Windows development machine?How to change the name of an iOS app?UITableView - change section header coloruipagecontrol indicator(dot)issueCustom UIPageControl dots color not changingchange the interspace between UIPageControl dotsHow to change Status Bar text color in iOSHow can I change image tintColor in iOS and WatchKitUIPageControl dots with larger space in between each dotsHow to change the color of pagination dots in UIPageControl with a different color per page