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?
Check if your destination country supports sender IDs
http://docs.aws.amazon.com/sns/latest/dg/sms_supported-countries.html