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
質問済み 2年前445ビュー
1回答
0
承認された回答

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
回答済み 2年前

ログインしていません。 ログイン 回答を投稿する。

優れた回答とは、質問に明確に答え、建設的なフィードバックを提供し、質問者の専門分野におけるスキルの向上を促すものです。

質問に答えるためのガイドライン

関連するコンテンツ