Emma API Documentation

Exports

With these endpoints, you can create member exports and view information about specific exports already created in your account.

GET /#account_id/exports

Get a list of all exports created for an account.

Parameters:
  • export_type (string) – 'a' audience, 'm' individual member export. Defaults to 'a' if no export type is specified.
Returns:

A list of exports created in the specified account over the past seven days. Status: "o" for OK, "e" for error, "q" for queued, "p" for in progress.

Sample Response [showhide]
GET /100/exports

[
    {
        "account_id": 100,
        "completed_at": "2019-09-06T19:34:30.962114+00:00",
        "created_at": "2019-09-06T19:34:30.628190+00:00",
        "criteria": {
            "groups": [
                1234
            ],
            "include_fields": true,
            "member_ids": null,
            "member_status_ids": [
                "a",
                "o",
                "e"
            ],
            "mfv_delimiter": ",",
            "segments": null,
            "subscriptions": null
        },
        "export_id": 1,
        "export_name": "Weekly Update",
        "export_type": "a",
        "status": "o",
        "user_id": "name@myemma.com"
    }
]

GET /#account_id/exports/#export_id

Get detailed information for a specific export.

Returns:Information about an export. Status: "o" for OK, "e" for error, "q" for queued, "p" for in progress.
Raises:Http404 if no export with the specified ID is found.

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

{
    "account_id": 100,
    "completed_at": "2019-09-06T19:34:30.962114+00:00",
    "created_at": "2019-09-06T19:34:30.628190+00:00",
    "criteria": {
        "groups": [
            1234
        ],
        "include_fields": true,
        "member_ids": null,
        "member_status_ids": [
            "a",
            "o",
            "e"
        ],
        "mfv_delimiter": ",",
        "segments": null,
        "subscriptions": null
    },
    "export_id": 200,
    "export_name": "Product Release News",
    "export_type": "a",
    "status": "o",
    "user_id": "name@myemma.com"
}

GET /#account_id/exports/#export_id/download

Get a CSV for the requested export.

Returns:If the export_type is 'a' (audience), download results in CSV form. If the export_type is 'm' (individual member), download results in a zip file.
Raises:Http404 if no export with the specified ID is found.

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

email,member_id,member_since,plaintext_preferred,bounce_count,status_name,last_modified_at,status-name,last_name,custom-field-name
email@email.com,123456789,2016-10-28T15:05:52 UTC,f,0,active,2019-05-07T20:44:21 UTC,,Last_name,,,2.0,37210,,,,b,,,,,,,,,,,,,
email1@email.com,234567890,2019-05-02T17:47:11 UTC,f,0,active,2019-05-02T17:47:11 UTC,,Member,,,,,,,,,

POST /#account_id/exports

Create an export of members.

Parameters:
  • user_id (string) – Required.
  • criteria (dictionary) – Describes what should be exported.
    • groups (array of integers) – List of group IDs
    • segments (array of integers) – List of segment IDs
    • member_ids (array of integers) – List of member IDs

    • The list of members to be exported will be a union of the members included in each provided group and segment, and the list of member_ids


    • member_status_ids (array of strings) – Status of the members
    • include_fields – Accepts True or an array of strings. Optional flag to include all member fields or a list of member fields.
Returns:

An export ID.

Sample Response [showhide]
    POST /100/exports
    {
        "user_id": "name@myemma.com",
        "criteria": {
            "groups": [12345, 67890],
            "member_status_ids": ["a"],
            "include_fields": true
        }
    }

    {
      "export_id": 1234
    }
    

POST /#account_id/exports/members/#member_id

Create an export of all information for an individual member. This will provide compliance with GDPR right to data portability.

Returns:An export ID.

Related Topics

Interested in Emma?

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