AWS SNS - boto3 - 指定 TemplateId 和 EntityId
AWS SNS - boto3 - Specify TemplateId and EntityId
以下代码用于发送带有发件人 ID 的消息,但我如何指定 TemplateId 和 EntityId?这两个字段是最近添加的,需要将 SMS 消息发送到印度的目的地。它是用消息属性完成的,但我无法弄清楚 syntax/keys.
client.publish(PhoneNumber=phone, Message=message,
MessageAttributes={
'AWS.SNS.SMS.SenderID': {
'DataType': 'String',
'StringValue': 'SenderID'
},
'AWS.SNS.SMS.SMSType': {
'DataType': 'String',
'StringValue': 'Transactional'
}})
AWS.SNS.SMS.TemplateId 和 AWS.SNS.SMS.TemplateID 键不起作用。
我得到这个错误:
Message attribute names starting with 'AWS.' or 'Amazon.' are reserved for use by Amazon.
详述 here,正确使用的键是 AWS.MM.SMS.EntityId
和 AWS.MM.SMS.TemplateId
。
以下代码用于发送带有发件人 ID 的消息,但我如何指定 TemplateId 和 EntityId?这两个字段是最近添加的,需要将 SMS 消息发送到印度的目的地。它是用消息属性完成的,但我无法弄清楚 syntax/keys.
client.publish(PhoneNumber=phone, Message=message,
MessageAttributes={
'AWS.SNS.SMS.SenderID': {
'DataType': 'String',
'StringValue': 'SenderID'
},
'AWS.SNS.SMS.SMSType': {
'DataType': 'String',
'StringValue': 'Transactional'
}})
AWS.SNS.SMS.TemplateId 和 AWS.SNS.SMS.TemplateID 键不起作用。
我得到这个错误:
Message attribute names starting with 'AWS.' or 'Amazon.' are reserved for use by Amazon.
详述 here,正确使用的键是 AWS.MM.SMS.EntityId
和 AWS.MM.SMS.TemplateId
。