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
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
add a comment |
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
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 gotNEXMO_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
add a comment |
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
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
python amazon-web-services sms amazon-sns boto3
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 gotNEXMO_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
add a comment |
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 gotNEXMO_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
add a comment |
2 Answers
2
active
oldest
votes
Check if your destination country supports sender IDs
http://docs.aws.amazon.com/sns/latest/dg/sms_supported-countries.html
add a comment |
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.
add a comment |
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
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
Check if your destination country supports sender IDs
http://docs.aws.amazon.com/sns/latest/dg/sms_supported-countries.html
add a comment |
Check if your destination country supports sender IDs
http://docs.aws.amazon.com/sns/latest/dg/sms_supported-countries.html
add a comment |
Check if your destination country supports sender IDs
http://docs.aws.amazon.com/sns/latest/dg/sms_supported-countries.html
Check if your destination country supports sender IDs
http://docs.aws.amazon.com/sns/latest/dg/sms_supported-countries.html
answered Apr 26 '17 at 10:48
Adam OwczarczykAdam Owczarczyk
1,337717
1,337717
add a comment |
add a comment |
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.
add a comment |
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.
add a comment |
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.
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.
edited Mar 6 at 23:54
Cody Gray♦
194k35380468
194k35380468
answered Mar 6 at 23:01
JaminaBeeJaminaBee
135
135
add a comment |
add a comment |
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.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
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
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