Request profile in segment export (beta)

Beta

This is a new feature in APSIS One API and we are still keeping a close look on performance and potential issues. Please report any feedback to [email protected].

Profile in segment export

Request an export with profiles from an existing segment (using segment_discriminator) or matching a provided AQL query (using segment_definition).

The AQL queries can be obtained by calling APSIS One API endpoints that provide them for specific scenarios. For example, to export all profiles who opened a specific email, use the AQL query returned by Get a specific email activity.

Optionally specify to include known or unknown profiles only.

The export file always contains the export key. You can select other attributes and tags to include their value as columns in the export file.

Downloading the requested export file

Once executed successfully, this endpoint returns a poll URL that is valid for 1 day. Call this URL repeatedly with exponential back-off using HTTP GET and the same authentication token as for the other APSIS One API calls. You will be getting one of the following responses:

When using the poll URL from file_download_url_v2 (in development):

  • HTTP 202 Accepted - export in progress
  • HTTP 200 OK - the export file is ready and is immediately streamed as a response
  • HTTP 410 Gone - the export file is no longer available
  • HTTP 404 Not Found - the ID provided is invalid

When using the poll URL from file_download_url:

  • HTTP 404 Not Found - export in progress, the export file is no longer available or the ID provided is invalid
  • HTTP 200 OK - the export file is ready and is immediately streamed as a response
  • HTTP 410 Gone - the export file is no longer available or the ID provided is invalid

Export file format

The Content-Type response header received when calling the poll URL specifies the export file format. Provide the Accept request header when calling the poll URL to select a different export file format. Supported values for these headers are:

  • CSV: text/csv;charset=UTF-8;header=present (default)
  • Excel: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet
  • JSON: application/json (in development)

You can download the same export multiple times using the same poll URL in different file formats.

Export file compression

By default the export file is not compressed so your code should treat it as, depending on the file format, .csv for example. If you prefer a compressed export, provide Accept-Encoding: gzip request header when calling the poll URL. The response will then contain Content-Encoding: gzip header and you will be able to handle the file as, depending on the file format, .csv.gz.

You can download the same export multiple times using the same poll URL with or without compression.

Limits

Receiving HTTP 413 Payload Too Large from this POST request usually means that the request body contains a number of attributes and/or tags that is currently not supported.

More information

Video guides

Content-Type response header

Accept request header

Accept-Encoding request header

Language
Credentials
Bearer
JWT
URL