Search code examples
python-3.xamazon-web-servicesboto3aws-pinpoint

How to use Pinpoint to send a text message from a long code in python?


I am currently using boto3 to send text messages to my audience. The problem is that the text message always comes from a short code regardless of whether I put one of my valid long codes in the OriginationNumber field.

client.send_messages(
    ApplicationId='appID',
    MessageRequest={
        'Context': {},
        'Addresses': {
            event['phone_number']: {
                "ChannelType": "SMS"
            }
        },
        'MessageConfiguration': {
            'SMSMessage': {
                'Body': 'hello world',
                'OriginationNumber': "+15405551234",
                'MessageType': 'TRANSACTIONAL'
            }
        }
    }
)

Solution

  • If anyone else runs into this. I have to open a support ticket with aws and provide them with a use case describing my application. So, sign-in into the console and head to the support section.