Publish message to AWS SNS

Send email and text notifications by publishing messages to Amazon’s Simple Notification Service.

PublishMessageToAWSSNS: function (_sOutboundTopicId, _oOptions)
+ _oOptions.Message:
+ _oOptions.Subject:
+ _oOptions.MessageDeduplicateionId:
+ _oOptions.MessageGroupId:
+ _oOptions.MessageAttributes:
++ _oMessageAttributes.DataType:
++ _oMessageAttributes.Value:

This utility doesn’t use a success or failure callback attribute in the request parameter.

Request parameter attributes

AttributeTypeDescriptionRequired
OutboundTopicIDstringThe ID of the asset in the third-party application.yes
OptionsobjectThe details of the message to send.yes

The Options object uses the following attributes:

AttributeTypeDescriptionRequired
MessagestringThe message to deliver to AWS SNS.yes
SubjectstringThe subject of the message.yes
MessageDeduplicationIdstringThe message deduplication ID.no
MessageGroupIdstringThe message group ID.no
MessageAttributesobjectThis object uses two properties:
  • DataType: Specify the data type of the attribute (string, string.array, number, or binary).
  • Value: The value of the attribute.
no

Response Parameter

A string representing a serialized response from AWS SNS.

Structure
{
  "Response": {
    "Message": "The message is published to AWS SNS”
  },
  "HTTPCode": -1,
  "Code": <SUCCESS | FAIL>
}
Example
Utils.PublishMessageToAWSSNS("2Y8TWAFUAIL", {
   Message: "This is a test message",
   Subject: "This is a test subject",
   MessageAttributes: {
      "key1": {
         DataType: "String",
         Value: "value1"
      },
      "key2": {
         DataType: "Number",
         Value: 1
      },
      "key3": {
         DataType: "String.Array",
         Value: ["value3","value4"]
      },
      "key4": {
         DataType: "Binary",
         Value: "value3"
      }
   }
});