Emma API Documentation

Response Exports

These endpoints allow you to create and interact with exports of response data in your account. Please note that these endpoints only provide information about response exports created using this API and will not return information or files related to response exports generated via Emma's UI.

POST /#account_id/exports/response

Create a response export. If no criteria is specified, the export created will contain response data for all mailings in the account from the last 30 days.

Supported criteria:
  • include_fields (boolean, list of strings) – Defaults to false. If true, export will include all member fields in the account. If list of strings, export will include all member fields by shortcut_name that exist in the account.
  • mailing_ids (array of integers) - Defaults to empty list. If no mailing_ids are specified, the last 50 mailings ordered by send_started (most recently sent mailings) will be included in the export. The maximum number of mailing_ids supported is 50.
  • from_date (datetime) - Defaults to none. Exports response data starting from the date specified, and cannot be farther back than the previous 18 months. If paired with to_date, the export will be rejected if the total time period is greater than 90 days. If mailing_ids are provided, the time period is not restricted.
  • to_date (datetime) - Defaults to none. Limits the response data exported up to the specified date. If paired with from_date, the export will be rejected if the total time period is greater than 90 days.
Returns:

An export ID.

Raises:Http400 if time between from_date and to_date is greater than 90 days or if more than 50 mailing_ids are requested.

Sample Response [showhide]
POST /100/exports/response

{
    "criteria": {
        "mailing_ids": [1234],
        "from_date": "2021-02-01",
        "to_date": "2021-02-17"
    }
}

{
    "export_id: 200"
}

GET /#account_id/exports/response

Get a list of response exports.

Returns:A detailed list of response exports for an account.

Sample Response [showhide]
GET /100/exports/response

[
    {
        "account_id": 100,
        "completed_at": "2021-02-08T23:11:35.746244+00:00",
        "created_at": "2021-02-08T23:11:33.463881+00:00",
        "criteria": {
            "from_date": "2021-01-10T00:00:00+00:00",
            "include_fields": false,
            "mailing_ids": [],
            "to_date": "2021-02-10T00:00:00+00:00"
        },
        "export_id": 200,
        "export_name": "response_export_2021-02-08_23:11",
        "export_type": "r",
        "status": "o",
        "user_id": null
    },
    {
        "account_id": 100,
        "completed_at": "2021-02-08T22:10:41.846488+00:00",
        "created_at": "2021-02-08T22:10:39.473941+00:00",
        "criteria": {
            "from_date": "2021-02-01T00:00:00+00:00",
            "include_fields": false,
            "mailing_ids": [],
            "to_date": "2021-02-15T00:00:00+00:00"
        },
        "export_id": 300,
        "export_name": "response_export_2021-02-08_22:10",
        "export_type": "r",
        "status": "o",
        "user_id": null
    }
]

GET /#account_id/exports/response/#export_id

Get details about a specific response export.

Returns:Information about the specified response export, including export criteria and date the export was created.
Raises:Http404 if no response export with the specified ID is found.

Sample Response [showhide]
GET /100/exports/response/200

{
    "account_id": 100,
    "completed_at": "2021-02-08T23:11:35.746244+00:00",
    "created_at": "2021-02-08T23:11:33.463881+00:00",
    "criteria": {
        "from_date": "2021-01-10T00:00:00+00:00",
        "include_fields": false,
        "mailing_ids": [],
        "to_date": "2021-02-10T00:00:00+00:00"
    },
    "export_id": 200,
    "export_name": "response_export_2021-02-08_23:11",
    "export_type": "r",
    "status": "o",
    "user_id": "abcdefg"
}

GET /#account_id/exports/response/#export_id/download

Download a file stream for the requested response export.

Returns:A zip file stream containing the following files in CSV format:
  • #export_id_bounces.csv
  • #export_id_clicks.csv (includes link_id, and link_name if specified)
  • #export_id_in_progress.csv (no timestamp included)
  • #export_id_opens.csv
  • #export_id_optout.csv
  • #export_id_received.csv
  • #export_id_sent_to.csv
  • #export_id_shares.csv
  • #export_id_signups.csv
Raises:Http404 if no response export with the specified ID is found.

Sample Response [showhide]
POST /100/exports/response/200/download

mailing_id,timestamp (in UTC),email,member_id,member_since,plaintext_preferred,bounce_count,status-name,last_modified_at,(member fields if set to 'true' in response export criteria)

Related Topics

Interested in Emma?

Emma's email marketing makes communicating simple and stylish. Get started today.