Amazon SNS Publish, howto set SenderID using MessageAttributes

0

I have trouble overriding the default SenderID when I Publish an SMS through Amazon SNS using Post. When I send the Post using this content body (phone number is dummy), it works, but uses the default SenderID:

Message=Test&PhoneNumber=+4712345678

My understanding is that I can add a MessageAttributes json like this:

{"AWS.SNS.SMS.SenderID":{"StringValue":"test","DataType":"String"}}

That gives the following content body, but when I try this override:

Message=Test&PhoneNumber=+4712345678&MessageAttributes=%7B%22AWS.SNS.SMS.SenderID%22:%7B%22StringValue%22:%22test%22,%22DataType%22:%22String%22%7D%7D

Then I get 400 Bad Request, and the following response:

{ "Error": { "Code": "MalformedInput", "Message": "End of list found where not expected", "Type": "Sender" }, "RequestId": "fd70e86a-79bc-5250-9e54-b3b397e2b707" }

What am I doing wrong? Do I have to create a pool in Pinpoint for SenderID?

Norway (+47) does not require preregistered SenderID. I'm using Delphi and the library sgcOpenApiAmazon, which is part of sgcWebSockets by esegece.com.

Thanks for any help

::tor

Midiar
asked 2 years ago454 views
1 Answer
0
Accepted Answer

I finally found out what the documentation meant, by using aws CLI with the --debug parameter. The following content body worked:

Message=Test&PhoneNumber=+4712345678&MessageAttributes.entry.1.Name=AWS.SNS.SMS.SenderID&MessageAttributes.entry.1.Value.StringValue=test&MessageAttributes.entry.1.Value.DataType=String&

::tor

Midiar
answered 2 years ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions