0

I have requested a dedicated long code number from AWS Pinpoint. And I have enabled two way sms for it. And tried to send TRANSACTIONAL SMS to a number, Although SMS's are receiving but they are not from My dedicated long code but they are from default senderId IM-NOTICE.

SAMPLE PYTHON CODE I TRIED:

region = "ap-south-1"

originationNumber = "+91xxxxxxxxxx"

destinationNumber = "+91xxxxxxxxxx"

message = ("This is a sample message sent from Amazon Pinpoint by using the "
           "AWS SDK for Python (Boto 3).")

applicationId = "xxxxxxxxxxxxxxxxx"

messageType = "TRANSACTIONAL"

registeredKeyword = "xxxxxx"

senderId = "MySenderID"

client = boto3.client('pinpoint',
                      aws_access_key_id='AKIAIVXXXXXXKHXXXXP33RWFHLNXXXXXXXYYA',
                      aws_secret_access_key='XXXUPbs6Kj6O2iXXXXXXXXXXXXXXX',
                      region_name=region)
try:
    response = client.send_messages(
        ApplicationId=applicationId,
        MessageRequest={
            'Addresses': {
                destinationNumber: {
                    'ChannelType': 'SMS'
                }
            },
            'MessageConfiguration': {
                'SMSMessage': {
                    'Body': message,
                    'Keyword': registeredKeyword,
                    'MessageType': messageType,
                    'OriginationNumber': originationNumber,
                    'SenderId': senderId
                }
            }
        }
    )

except ClientError as e:
    print(e.response['Error']['Message'])
else:
    print("Message sent! Message ID: "
          + response['MessageResponse']['Result'][destinationNumber]['MessageId'])
Naroju
  • 2,637
  • 4
  • 25
  • 44
  • what error are you getting? what behavior are you seeing and what is your expected result? – JD D May 27 '19 at 00:16
  • My expected behaviour is simple, Whoever receives messages from dedicated long number should see the dedicated long number but not the default senderId. I am not getting any error messages are being sent but with senderId as display name and not dedicated number. Thank you for replying – Naroju May 27 '19 at 02:35

0 Answers0