Exports raw data to downloadable files. Data is split into roughly 256 MB files, and is not necessarily ordered. Each file contains 1 line per session, with each session JSON-encoded. Export files are automatically deleted 24 hours after export occurs. Data becomes available to export every 2 to 4 hours, and only for complete sessions. You cannot export data that has become available more than 60 days ago. You may only export data 24 times per day. Exports with invalid arguments do not count towards this limit.
To construct an api call to export raw data, you will need, at least, the following:
- APP_ID_KEY - Can be found in the keys & settings of your app.
- EXPORT_KEY - Can be found in the keys & settings of your app.
- startDate - this is the date that you would want to export data from.
And your API call will be constructed to look like the following:
The following arguments are optional:
|endDate||String||Last date in range to include in PDT/PST (format: YYYYmmdd). Defaults to startDate if not provided. Example: 20141118|
|startTime||Number||First time (when data became available) to include (seconds since midnight UTC on January 1, 1970). If not provided, accepts all times before endTime, or all times if endTime is also not provided. The main use is to set this to the last time you exported data to only get the new data since your last export.
|endTime||Number||Last time (when data became available) to include (seconds since midnight UTC on January 1, 1970). If not provided, accepts all times after startTime, or all times if startTime is also not provided.|
|callbackUrl||String||URL to POST a response to when the export completes. The response is the response format of getExportResults.|
|exportFormat||String||The format to export data. Can be either
|s3BucketName||String||The name of an AWS S3 bucket to copy exported files to.|
|s3AccessId||String||The AWS Access ID used to authenticate to S3. Required if s3BucketName is set.|
|s3AccessKey||String||The AWS Secret Access Key used to authenticate to S3. Required if s3BucketName is set.|
|s3ObjectPrefix||String||An optional prefix of files to write to S3. Example: dirname/ to write files to a directory within the S3 bucket.|
|compressData||Boolean||An option to compress the data. Only works when uploading to S3. If set to true, the files will be compressed using gzip before being uploaded.|
|jobId||String||The job ID of the pending export job, if data matching supplied arguments is available.|
To then get the files with the jobId, the call would be constructed in the following manner:
The resulting file will give you data about a user's session such as their device, the events that they've triggered, userAttributes and etc. The file will either be in JSON or CSV format, depending on how you construct the call.
To automate this process with a Python Script, please see more here.