To get all of the information that Amazon Pinpoint has about your audience, you can export the endpoint definitions that belong to a project. When you export, Amazon Pinpoint places the endpoint definitions in an Amazon S3 bucket that you specify. Exporting endpoints is useful when you want to:
-
View the latest data about new and existing endpoints that your client application registered with Amazon Pinpoint.
-
Synchronize the endpoint data in Amazon Pinpoint with your own Customer Relationship Management (CRM) system.
-
Create reports about or analyze your customer data.
Note
Content delivered to Amazon S3 buckets might contain customer content. If you need to delete endpoint data that you exported to an Amazon S3 bucket, you must do so in Amazon S3 For more information about removing sensitive data, see How Do I Empty an S3 Bucket? or How Do I Delete an S3 Bucket?.
Before you begin
Before you can export endpoints, you need the following resources in your AWS account:
-
An Amazon S3 bucket. To create a bucket, see Create a bucket in the Amazon Simple Storage Service User Guide.
-
An AWS Identity and Access Management (IAM) role that grants Amazon Pinpoint write permissions for your Amazon S3 bucket. To create the role, see IAM role for exporting endpoints or segments.
Examples
The following examples demonstrate how to export endpoints from an Amazon Pinpoint project, and then download those endpoints from your Amazon S3 bucket.
You can use Amazon Pinpoint by running commands with the AWS CLI.
Example Create export job command
To export the endpoints in your Amazon Pinpoint project, use the create-export-job
command:
$
aws pinpoint create-export-job \
>
--application-id
application-id
\>
--export-job-request \
>
S3UrlPrefix=s3://
bucket-name/prefix/
,\>
RoleArn=
iam-export-role-arn
Where:
-
is the ID of the Amazon Pinpoint project that contains the endpoints.application-id
-
is the name of your Amazon S3 bucket and, optionally, a prefix that helps you organize the objects in your bucket hierarchically. For example, a useful prefix might bebucket-name/prefix/
pinpoint/exports/endpoints/
. -
is the Amazon Resource Name (ARN) of an IAM role that grants Amazon Pinpoint write access to the bucket.iam-export-role-arn
The response to this command provides details about the export job:
{
"ExportJobResponse": {
"CreationDate": "2018-06-04T22:04:20.585Z",
"Definition": {
"RoleArn": "iam-export-role-arn",
"S3UrlPrefix": "s3://s3-bucket-name/prefix/"
},
"Id": "7390e0de8e0b462380603c5a4df90bc4",
"JobStatus": "CREATED",
"Type": "EXPORT"
}
}
The response provides the job ID with the Id
attribute.
You can use this ID to check the current status of the export
job.
Example Get export job command
To check the current status of an export job, use the get-export-job
command:
$
aws pinpoint get-export-job \
>
--application-id
application-id
\>
--job-id
job-id
Where:
-
is the ID the Amazon Pinpoint project that you exported the endpoints from.application-id
-
is the ID of the job that you're checking.job-id
The response to this command provides the current state of the export job:
{
"ExportJobResponse": {
"ApplicationId": "application-id",
"CompletedPieces": 1,
"CompletionDate": "2018-05-08T22:16:48.228Z",
"CreationDate": "2018-05-08T22:16:44.812Z",
"Definition": {},
"FailedPieces": 0,
"Id": "6c99c463f14f49caa87fa27a5798bef9",
"JobStatus": "COMPLETED",
"TotalFailures": 0,
"TotalPieces": 1,
"TotalProcessed": 215,
"Type": "EXPORT"
}
}
The response provides the job status with the JobStatus
attribute. When the job status value is COMPLETED
, you can get
your exported endpoints from your Amazon S3 bucket.
Example S3 CP command
To download your exported endpoints, use the Amazon S3 cp
command:
$
aws s3 cp s3://
bucket-name/prefix/key.gz
/local/directory/
Where:
-
is the location of the .gz file that Amazon Pinpoint added to your bucket when you exported your endpoints. This file contains the exported endpoint definitions. For example, in the URLbucket-name/prefix/key
https://PINPOINT-EXAMPLE-BUCKET.s3.us-west-2.amazonaws.com/Exports/example.csv
,PINPOINT-EXAMPLE-BUCKET
is the name of the bucket andExports/example.csv
is the key. For more information on Keys, see Keys in the Amazon S3 User Guide. -
is the file path to the local directory that you want to download the endpoints to./local/directory/
Related information
To find the endpoint ID for a specific endpoint, you must determine which segment the endpoint belongs to, and then export the segment from Amazon Pinpoint. The exported data includes the endpoint ID for each endpoint. You can export a segment to a file by using the Amazon Pinpoint console. For more information about exporting segments, see Exporting Segments in the Amazon Pinpoint User Guide.
For more information about the Export Jobs resource in the Amazon Pinpoint API, including the supported HTTP methods and request parameters, see Export jobs in the Amazon Pinpoint API Reference.