ebook img

Amazon Pinpoint - Developer Guide PDF

104 Pages·2017·1.34 MB·English
by  
Save to my drive
Quick download
Download
Most books are stored in the elastic cloud where traffic is expensive. For this reason, we have a limit on daily download.

Preview Amazon Pinpoint - Developer Guide

Amazon Pinpoint Developer Guide Amazon Pinpoint Developer Guide Amazon Pinpoint: Developer Guide Copyright © 2022 Amazon Web Services, Inc. and/or its affiliates. All rights reserved. Amazon's trademarks and trade dress may not be used in connection with any product or service that is not Amazon's, in any manner that is likely to cause confusion among customers, or in any manner that disparages or discredits Amazon. All other trademarks not owned by Amazon are the property of their respective owners, who may or may not be affiliated with, connected to, or sponsored by Amazon. Amazon Pinpoint Developer Guide Table of Contents What is Amazon Pinpoint?.................................................................................................................. 1 Amazon Pinpoint features........................................................................................................... 1 Define audience segments................................................................................................... 1 Engage your audience with messaging campaigns .................................................................. 1 Send transactional messages ............................................................................................... 1 Analyze user behavior ......................................................................................................... 1 Regional availability................................................................................................................... 2 Tutorials............................................................................................................................................ 3 Using Postman with Amazon Pinpoint .......................................................................................... 3 About this tutorial.............................................................................................................. 3 Prerequisites...................................................................................................................... 4 Step 1: Create IAM policies and roles .................................................................................... 4 Step 2: Set up Postman ...................................................................................................... 6 Step 3: Send additional requests ........................................................................................ 12 Setting up an SMS registration system ........................................................................................ 17 About double opt-in ......................................................................................................... 18 About this solution........................................................................................................... 18 Prerequisites.................................................................................................................... 19 Step 1: Set up Amazon Pinpoint ........................................................................................ 20 Step 2: Create IAM policies and roles .................................................................................. 23 Step 3: Create Lambda functions ....................................................................................... 24 Step 4: Set up Amazon API Gateway ................................................................................... 32 Step 5: Create and deploy the web form ............................................................................. 37 Next steps....................................................................................................................... 42 Integrating with your application ....................................................................................................... 45 Working with AWS SDKs ........................................................................................................... 45 Integrating the mobile SDKs or JS library .................................................................................... 46 Integrating mobile SDKs................................................................................................... 46 Integrating AWS Amplify ................................................................................................... 46 Next step........................................................................................................................ 47 Registering endpoints............................................................................................................... 47 Before you begin .............................................................................................................. 47 AWS mobile SDKs ............................................................................................................. 47 AWS Amplify................................................................................................................... 47 Next steps....................................................................................................................... 48 Reporting events...................................................................................................................... 48 Before you begin .............................................................................................................. 49 AWS mobile SDKs ............................................................................................................. 49 Web and react native ........................................................................................................ 47 Amazon Pinpoint events API .............................................................................................. 49 Next step........................................................................................................................ 49 Handling push notifications....................................................................................................... 49 Setting up push notifications ............................................................................................. 50 Handling push notifications............................................................................................... 51 Defining your audience..................................................................................................................... 52 Adding endpoints..................................................................................................................... 52 Examples......................................................................................................................... 53 Related information.......................................................................................................... 57 Associating users with endpoints................................................................................................ 57 Examples......................................................................................................................... 57 Related information.......................................................................................................... 60 Adding a batch of endpoints..................................................................................................... 61 Examples......................................................................................................................... 61 Related information.......................................................................................................... 65 iii Amazon Pinpoint Developer Guide Importing endpoints................................................................................................................. 65 Before you begin .............................................................................................................. 66 Examples......................................................................................................................... 66 Related information.......................................................................................................... 74 Deleting endpoints................................................................................................................... 74 Examples......................................................................................................................... 74 Managing audience members endpoints ...................................................................................... 76 Accessing audience data .................................................................................................................... 77 Looking up endpoints............................................................................................................... 77 Examples......................................................................................................................... 77 Related information.......................................................................................................... 81 Exporting endpoints................................................................................................................. 81 Before you begin .............................................................................................................. 81 Examples......................................................................................................................... 81 Related information.......................................................................................................... 87 Listing endpoint IDs.................................................................................................................. 87 Creating segments............................................................................................................................ 89 Building segments.................................................................................................................... 89 Building segments with the AWS SDK for Java ..................................................................... 89 Importing segments................................................................................................................. 90 Importing a segment ........................................................................................................ 91 Customizing segments with AWS Lambda ................................................................................... 92 Event data....................................................................................................................... 92 Creating a Lambda function .............................................................................................. 93 Assigning a Lambda function policy .................................................................................... 95 Assigning a Lambda function to a campaign ........................................................................ 96 Creating campaigns.......................................................................................................................... 98 Creating standard campaigns..................................................................................................... 98 Creating campaigns with the AWS SDK for Java ................................................................... 98 Creating A/B test campaigns ..................................................................................................... 99 Creating A/B test campaigns with the AWS SDK for Java ....................................................... 99 Using the SMS and Voice API ........................................................................................................... 101 Concepts in the SMS and Voice API, version 2 ............................................................................ 101 Managing phone numbers....................................................................................................... 102 Requesting phone numbers ............................................................................................. 103 Modifying phone number capabilities ................................................................................ 104 Listing phone numbers.................................................................................................... 106 Releasing phone numbers ................................................................................................ 107 Managing sender IDs.............................................................................................................. 108 Associating a sender ID with a pool.................................................................................. 108 Setting a default sender ID for a configuration set .............................................................. 109 Disassociating a sender ID from a configuration set ............................................................ 110 Managing pools...................................................................................................................... 110 Creating a pool .............................................................................................................. 111 Adding origination identities to pools ............................................................................... 112 Listing pools.................................................................................................................. 113 Listing the origination identities in a pool.......................................................................... 114 Deleting pools................................................................................................................ 115 Managing opt-out lists ............................................................................................................ 115 Creating an opt-out list ................................................................................................... 116 Listing the opt-out lists in your account ............................................................................ 116 Adding destination numbers to an opt-out list ................................................................... 117 Removing destination numbers from an opt-out list ........................................................... 118 Managing configuration sets .................................................................................................... 119 Creating a configuration set ............................................................................................. 119 Listing configuration sets ................................................................................................. 120 Deleting configuration sets .............................................................................................. 121 iv Amazon Pinpoint Developer Guide Managing event destinations ................................................................................................... 122 Event types.................................................................................................................... 122 Creating event destinations ............................................................................................. 124 Updating event destinations ............................................................................................ 124 Deleting event destinations ............................................................................................. 124 Managing CloudWatch Logs event destinations .................................................................. 125 Managing Kinesis Data Firehose event destinations ............................................................. 128 Managing Amazon SNS event destinations ........................................................................ 131 Sending messages.................................................................................................................. 133 Sending SMS Messages................................................................................................... 133 Sending Voice Messages .................................................................................................. 135 Sending and validating one-time passwords ...................................................................................... 137 Sending an OTP message ........................................................................................................ 137 SendOtpMessage Response............................................................................................ 139 Validating an OTP message ..................................................................................................... 139 VerifyOtpMessage Response........................................................................................ 140 Code examples....................................................................................................................... 141 Generating a reference ID ................................................................................................ 141 Sending OTP codes ......................................................................................................... 141 Validating OTP codes ...................................................................................................... 142 Sending and retrieving in-app messages ............................................................................................ 144 Retrieving in-app messages for an endpoint .............................................................................. 144 Understanding GetInAppMessages API responses ..................................................................... 146 InAppMessageCampaigns object.................................................................................... 147 InAppMessage object.................................................................................................... 148 HeaderConfig object.................................................................................................... 148 BodyConfig object........................................................................................................ 149 InAppMessageContent object....................................................................................... 149 Schedule object............................................................................................................ 150 InAppMessageButton object......................................................................................... 150 DefaultButtonConfig object....................................................................................... 151 OverrideButtonConfig object...................................................................................... 152 Validating phone numbers ............................................................................................................... 153 Phone number validation use cases.......................................................................................... 153 Using the phone number validation service ............................................................................... 153 Phone number validation responses .......................................................................................... 154 Sending messages.......................................................................................................................... 157 Send email............................................................................................................................ 157 Choosing an email-sending method.................................................................................. 158 Choosing between Amazon Pinpoint and Amazon Simple Email Service (SES) ......................... 158 Using the API................................................................................................................. 158 Using the SMTP interface ................................................................................................ 166 Send SMS messages............................................................................................................... 173 Send voice messages .............................................................................................................. 180 Send push notifications........................................................................................................... 184 Creating custom channels ................................................................................................................ 190 Creating a campaign that sends messages through a custom channel ............................................ 190 Understanding event data ....................................................................................................... 191 Configuring webhooks............................................................................................................. 192 Configuring Lambda functions ................................................................................................. 192 Example Lambda function ............................................................................................... 192 Lambda function response format for Amazon Pinpoint ...................................................... 195 Granting Amazon Pinpoint permission to invoke the Lambda function ................................... 196 Streaming events............................................................................................................................ 198 Setting up event streaming .................................................................................................... 198 Prerequisites.................................................................................................................. 199 AWS CLI........................................................................................................................ 199 v Amazon Pinpoint Developer Guide AWS SDK for Java .......................................................................................................... 199 Disabling event streaming ............................................................................................... 200 App events............................................................................................................................ 200 Example........................................................................................................................ 200 App event attributes ....................................................................................................... 201 Campaign events.................................................................................................................... 204 Sample event................................................................................................................. 204 Campaign event attributes ............................................................................................... 205 Journey events....................................................................................................................... 208 Sample event................................................................................................................. 208 Journey event attributes .................................................................................................. 209 Email events.......................................................................................................................... 211 Sample events............................................................................................................... 212 Email event attributes ..................................................................................................... 216 SMS events............................................................................................................................ 220 Example........................................................................................................................ 220 SMS event attributes ...................................................................................................... 221 Querying analytics data .................................................................................................................. 226 Supported metrics.................................................................................................................. 226 Query basics.......................................................................................................................... 227 IAM policies........................................................................................................................... 228 Standard metrics.................................................................................................................... 230 Application metrics for campaigns.................................................................................... 231 Application metrics for transactional email messages .......................................................... 234 Application metrics for transactional SMS messages ............................................................ 240 Campaign metrics........................................................................................................... 243 Journey engagement metrics........................................................................................... 248 Journey execution metrics ............................................................................................... 252 Journey activity execution metrics .................................................................................... 253 Querying campaign data ......................................................................................................... 256 Prerequisites.................................................................................................................. 257 Querying data for one campaign ...................................................................................... 257 Querying data for multiple campaigns .............................................................................. 261 Querying transactional messaging data ..................................................................................... 265 Prerequisites.................................................................................................................. 265 Querying data for transactional email messages ................................................................. 266 Querying data for transactional SMS messages .................................................................. 269 Using query results ................................................................................................................. 273 JSON structure............................................................................................................... 273 JSON objects and fields .................................................................................................. 277 Logging API calls............................................................................................................................ 279 Amazon Pinpoint information in CloudTrail ................................................................................ 279 Amazon Pinpoint API actions that can be logged by CloudTrail ..................................................... 280 Amazon Pinpoint email API actions that can be logged by CloudTrail ............................................ 283 Amazon Pinpoint SMS and voice API version 1 actions that can be logged by CloudTrail ................... 283 Amazon Pinpoint SMS and voice API version 2 actions that can be logged by CloudTrail ................... 284 Examples: Amazon Pinpoint log file entries ................................................................................ 285 Tagging resources........................................................................................................................... 289 Managing tags....................................................................................................................... 289 Using tags in IAM policies........................................................................................................ 289 Adding tags to resources ......................................................................................................... 290 Adding tags by using the API ........................................................................................... 290 Adding tags by using the AWS CLI .................................................................................... 291 Displaying tags for resources ................................................................................................... 292 Displaying tags by using the API ...................................................................................... 292 Displaying tags by using the AWS CLI ............................................................................... 293 Updating tags for resources ..................................................................................................... 294 vi Amazon Pinpoint Developer Guide Updating tags by using the API ........................................................................................ 294 Updating tags by using the AWS CLI ................................................................................. 294 Removing tags from resources ................................................................................................. 295 Removing tags by using the API ....................................................................................... 296 Removing tags by using the AWS CLI ................................................................................ 296 Related information................................................................................................................ 297 Customizing recommendations with AWS Lambda .............................................................................. 298 Using recommendations in messages ........................................................................................ 298 Creating the Lambda function .................................................................................................. 300 Input event data ............................................................................................................ 300 Response data and requirements ...................................................................................... 301 Assigning a Lambda function policy .......................................................................................... 305 Authorizing Amazon Pinpoint to invoke the function ................................................................... 306 Configuring the Recommender Model ....................................................................................... 306 Deleting data................................................................................................................................. 308 Deleting endpoints................................................................................................................. 308 Deleting Segment and Endpoint Data from Amazon S3 ............................................................... 308 Deleting all project data .......................................................................................................... 309 Deleting All AWS Data ............................................................................................................ 309 Code examples............................................................................................................................... 311 Amazon Pinpoint examples ...................................................................................................... 311 Actions.......................................................................................................................... 312 Amazon Pinpoint SMS and Voice API examples .......................................................................... 346 Actions.......................................................................................................................... 346 Security......................................................................................................................................... 351 Data protection...................................................................................................................... 351 Data encryption............................................................................................................. 353 Internetwork traffic privacy .............................................................................................. 353 Identity and access management .............................................................................................. 354 Audience....................................................................................................................... 354 Authenticating with identities.......................................................................................... 354 Managing access using policies ......................................................................................... 356 How Amazon Pinpoint works with IAM .............................................................................. 358 Amazon Pinpoint policy actions ........................................................................................ 363 Identity-based policy examples ........................................................................................ 388 IAM roles for common tasks ............................................................................................ 397 Troubleshooting............................................................................................................. 406 Logging and monitoring.......................................................................................................... 408 Compliance validation............................................................................................................. 409 Resilience.............................................................................................................................. 409 Infrastructure security............................................................................................................. 410 Configuration and vulnerability analysis .................................................................................... 410 Security best practices ............................................................................................................ 411 Quotas.......................................................................................................................................... 412 Project quotas........................................................................................................................ 412 API request quotas ................................................................................................................. 412 SMS and Voice v2 API request quotas ....................................................................................... 414 Campaign quotas................................................................................................................... 415 Email quotas.......................................................................................................................... 416 Email message quotas..................................................................................................... 416 Email sender and recipient quotas .................................................................................... 416 Email sending quotas...................................................................................................... 417 Endpoint quotas..................................................................................................................... 418 Endpoint import quotas .......................................................................................................... 419 Event ingestion quotas ............................................................................................................ 419 Journey quotas...................................................................................................................... 420 Lambda quotas...................................................................................................................... 420 vii Amazon Pinpoint Developer Guide Machine learning quotas......................................................................................................... 421 Message template quotas........................................................................................................ 421 Push notification quotas.......................................................................................................... 422 In-app message quotas........................................................................................................... 423 Segment quotas..................................................................................................................... 423 SMS quotas........................................................................................................................... 423 10DLC quotas........................................................................................................................ 425 Voice quotas.......................................................................................................................... 425 Requesting a quota increase .................................................................................................... 426 Document history........................................................................................................................... 428 Earlier updates....................................................................................................................... 431 viii Amazon Pinpoint Developer Guide Amazon Pinpoint features What is Amazon Pinpoint? Amazon Pinpoint is an AWS service that you can use to engage with your customers across multiple messaging channels. You can use Amazon Pinpoint to send push notifications, emails, SMS text messages, or voice messages. The information in this developer guide is intended for application developers. This guide contains information about using the features of Amazon Pinpoint programmatically. It also contains information of particular interest to mobile app developers, such as procedures for integrating analytics and messaging features with your application (p. 45). There are several other documents that are companions to this document. The following documents provide reference information related to the Amazon Pinpoint APIs: • Amazon Pinpoint API Reference • Amazon Pinpoint SMS and voice API If you're new to Amazon Pinpoint, you might find it helpful to review the Amazon Pinpoint User Guide before proceeding with this document. Amazon Pinpoint features This section describes the major features of Amazon Pinpoint and the tasks that you can perform by using them. Define audience segments Reach the right audience for your messages by defining audience segments (p. 89). A segment designates which users receive the messages that are sent from a campaign. You can define dynamic segments based on data that's reported by your application, such as operating system or mobile device type. You can also import static segments that you define by using another service or application. Engage your audience with messaging campaigns Engage your audience by creating a messaging campaign (p. 98). A campaign sends tailored messages on a schedule that you define. You can create campaigns that send mobile push, email, or SMS messages. To experiment with alternative campaign strategies, set up your campaign as an A/B test, and analyze the results with Amazon Pinpoint analytics. Send transactional messages Keep your customers informed by sending transactional mobile push and SMS messages—such as new account activation messages, order confirmations, and password reset notifications— directly to specific users. You can send transactional messages by using the Amazon Pinpoint REST API. Analyze user behavior Gain insights about your audience and the effectiveness of your campaigns by using the analytics that Amazon Pinpoint provides. You can view trends about your users' level of engagement, purchase activity, 1 Amazon Pinpoint Developer Guide Regional availability demographics, and more. You can also monitor your message traffic by viewing metrics such as the total number of messages that were sent or opened for a campaign or application. Through the Amazon Pinpoint API, your application can report custom data, which Amazon Pinpoint makes available for analysis, and you can query analytics data for certain standard metrics. To analyze or store analytics data outside Amazon Pinpoint, you can configure Amazon Pinpoint to stream the data (p. 198) to Amazon Kinesis. Regional availability Amazon Pinpoint is available in several AWS Regions in North America, Europe, Asia, and Oceania. In each Region, AWS maintains multiple Availability Zones. These Availability Zones are physically isolated from each other, but are united by private, low-latency, high-throughput, and highly redundant network connections. These Availability Zones enable us to provide very high levels of availability and redundancy, while also minimizing latency. To learn more about AWS Regions, see Managing AWS Regions in the Amazon Web Services General Reference. For a list of all the Regions where Amazon Pinpoint is currently available, see AWS service endpoints in the Amazon Web Services General Reference. To learn more about the number of Availability Zones that are available in each Region, see AWS global infrastructure. 2

Description:
Amazon's trademarks and trade dress may not be used in connection with any product or service that is not Amazon's, in any manner that is likely to cause confusion among customers, or in any manner that disparages or discredits Amazon. All other trademarks not owned by Amazon are the property of
See more

The list of books you might like

Most books are stored in the elastic cloud where traffic is expensive. For this reason, we have a limit on daily download.