1

If I have a segment of users in AWS Pinpoint and I want to send that segment a SNS Push message from a Lambda function, what API function do I use?

The AWS Javascript SDK allows me to create and update a segment but it does NOT have anything that allows me to send a message to a segment.

It does have sendMessages and sendUsersMessages but these do NOT allow me to send by segment

enter image description here

Zigglzworth
  • 6,645
  • 9
  • 68
  • 107

1 Answers1

2

Segments can be delivered to via campaigns, so you would probably want to create an Immediate Campaign to deliver to your segment (can be done from within a lambda function like any AWS API).

https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/Pinpoint.html#createCampaign-property

Edit: That API looks pretty complex, a simple example can be found here: http://docs.aws.amazon.com/pinpoint/latest/developerguide/campaigns.html

Cheruvian
  • 5,628
  • 1
  • 24
  • 34
  • 1
    That tells me how to create a campaign with the API which I know how to do. But how do I SEND messages to that campaign with the API? – Zigglzworth Dec 15 '17 at 14:32
  • 1
    A campaign is simply a message sent to a segment (with advanced scheduling/sending options like local time etc...). The messageConfiguration property of a campaign is the Message that will be sent to the SegmentId property of the campaign. – Cheruvian Dec 17 '17 at 09:04