CTRLK

Shared components

Events export

|

View as Markdown

If you want to use the customer activity from all your events in an external system or application, the Events Export API enables you to extract events data. Set up your export in three simple steps. Be aware that exported events are subject to the data retention policy.


Set up Amazon S3 bucket

The Events Export API uploads events data as compressed files to an Amazon S3 cloud storage.

To set up your S3 bucket:

  1. Create an Amazon Web Services S3 bucket for your exports.
  2. Note your bucket name and region for the next steps.

For detailed instructions, see the Amazon AWS documentation.


Configure permissions

Once you have set up your S3 bucket, use AWS Identity and Access Management (IAM) to create a role for the Events Export application to access the S3 bucket.

The role requires two policies:

  1. S3 access policy - Allow access to your S3 bucket
  2. Trust policy - Allow the Events Export application user to obtain a temporary session using the AWS Security Token Service

Trust policy JSON:

json
1{
2 "Effect":"Allow",
3 "Principal":{
4 "AWS":[
5 "arn:aws:iam::415293638486:user/infobip-people-event-export-user"
6 ]
7 },
8 "Action":"sts:AssumeRole",
9 "Condition":{
10 "StringEquals":{
11 "sts:ExternalId":"infobip-people-event-export"
12 }
13 }
14}

After you have set the appropriate permissions, your S3 bucket will be ready to accept exported files from Infobip.


Export your events

Submit a request to export events following the schema defined in the Events Export API documentation.

The Events Export API processes requests asynchronously. You can check your request status to see if it has been completed.

Once the status is COMPLETED_SUCCESSFULLY, the export files containing your events are uploaded to the designated S3 bucket.


Export file format

Exported event files have the following characteristics:

  • Format: Compressed .gzip files
  • Filename: <requestId>-events-<startTime>-<endTime>.json.gz
  • Content: Maximum 50,000 rows per file, each row contains one event in JSON format

You can specify the directory path of the S3 bucket where files are saved.


Event schema

Each exported event contains mandatory fields and optional event-specific properties.

Mandatory fields [#mandatory-fields-event-schema]

Field nameValue formatDescription
definitionIdStringDefinition (type) of the event. See Get list of event definitions.
personIdStringUnique identifier of the person profile.
externalPersonIdStringExternal identifier of the person profile.
timestampISO 8601Time when the event occurred.
propertiesObjectEvent-specific properties defined for the event.