SESV2 / Client / create_export_job

create_export_job#

SESV2.Client.create_export_job(**kwargs)#

Creates an export job for a data source and destination.

You can execute this operation no more than once per second.

See also: AWS API Documentation

Request Syntax

response = client.create_export_job(
    ExportDataSource={
        'MetricsDataSource': {
            'Dimensions': {
                'string': [
                    'string',
                ]
            },
            'Namespace': 'VDM',
            'Metrics': [
                {
                    'Name': 'SEND'|'COMPLAINT'|'PERMANENT_BOUNCE'|'TRANSIENT_BOUNCE'|'OPEN'|'CLICK'|'DELIVERY'|'DELIVERY_OPEN'|'DELIVERY_CLICK'|'DELIVERY_COMPLAINT',
                    'Aggregation': 'RATE'|'VOLUME'
                },
            ],
            'StartDate': datetime(2015, 1, 1),
            'EndDate': datetime(2015, 1, 1)
        },
        'MessageInsightsDataSource': {
            'StartDate': datetime(2015, 1, 1),
            'EndDate': datetime(2015, 1, 1),
            'Include': {
                'FromEmailAddress': [
                    'string',
                ],
                'Destination': [
                    'string',
                ],
                'Subject': [
                    'string',
                ],
                'Isp': [
                    'string',
                ],
                'LastDeliveryEvent': [
                    'SEND'|'DELIVERY'|'TRANSIENT_BOUNCE'|'PERMANENT_BOUNCE'|'UNDETERMINED_BOUNCE'|'COMPLAINT',
                ],
                'LastEngagementEvent': [
                    'OPEN'|'CLICK',
                ]
            },
            'Exclude': {
                'FromEmailAddress': [
                    'string',
                ],
                'Destination': [
                    'string',
                ],
                'Subject': [
                    'string',
                ],
                'Isp': [
                    'string',
                ],
                'LastDeliveryEvent': [
                    'SEND'|'DELIVERY'|'TRANSIENT_BOUNCE'|'PERMANENT_BOUNCE'|'UNDETERMINED_BOUNCE'|'COMPLAINT',
                ],
                'LastEngagementEvent': [
                    'OPEN'|'CLICK',
                ]
            },
            'MaxResults': 123
        }
    },
    ExportDestination={
        'DataFormat': 'CSV'|'JSON',
        'S3Url': 'string'
    }
)
Parameters:
  • ExportDataSource (dict) –

    [REQUIRED]

    The data source for the export job.

    • MetricsDataSource (dict) –

      An object that contains details about the data source for the metrics export.

      • Dimensions (dict) – [REQUIRED]

        An object that contains a mapping between a MetricDimensionName and MetricDimensionValue to filter metrics by. Must contain a least 1 dimension but no more than 3 unique ones.

        • (string) –

          The BatchGetMetricDataQuery dimension name. This can be one of the following:

          • EMAIL_IDENTITY – The email identity used when sending messages.

          • CONFIGURATION_SET – The configuration set used when sending messages (if one was used).

          • ISP – The recipient ISP (e.g. Gmail, Yahoo, etc.).

          • (list) –

            • (string) –

              A list of values associated with the MetricDimensionName to filter metrics by. Can either be * as a wildcard for all values or a list of up to 10 specific values. If one Dimension has the * value, other dimensions can only contain one value.

      • Namespace (string) – [REQUIRED]

        The metrics namespace - e.g., VDM.

      • Metrics (list) – [REQUIRED]

        A list of ExportMetric objects to export.

        • (dict) –

          An object that contains a mapping between a Metric and MetricAggregation.

          • Name (string) –

            The metric to export, can be one of the following:

            • SEND - Emails sent eligible for tracking in the VDM dashboard. This excludes emails sent to the mailbox simulator and emails addressed to more than one recipient.

            • COMPLAINT - Complaints received for your account. This excludes complaints from the mailbox simulator, those originating from your account-level suppression list (if enabled), and those for emails addressed to more than one recipient

            • PERMANENT_BOUNCE - Permanent bounces - i.e., feedback received for emails sent to non-existent mailboxes. Excludes bounces from the mailbox simulator, those originating from your account-level suppression list (if enabled), and those for emails addressed to more than one recipient.

            • TRANSIENT_BOUNCE - Transient bounces - i.e., feedback received for delivery failures excluding issues with non-existent mailboxes. Excludes bounces from the mailbox simulator, and those for emails addressed to more than one recipient.

            • OPEN - Unique open events for emails including open trackers. Excludes opens for emails addressed to more than one recipient.

            • CLICK - Unique click events for emails including wrapped links. Excludes clicks for emails addressed to more than one recipient.

            • DELIVERY - Successful deliveries for email sending attempts. Excludes deliveries to the mailbox simulator and for emails addressed to more than one recipient.

            • DELIVERY_OPEN - Successful deliveries for email sending attempts. Excludes deliveries to the mailbox simulator, for emails addressed to more than one recipient, and emails without open trackers.

            • DELIVERY_CLICK - Successful deliveries for email sending attempts. Excludes deliveries to the mailbox simulator, for emails addressed to more than one recipient, and emails without click trackers.

            • DELIVERY_COMPLAINT - Successful deliveries for email sending attempts. Excludes deliveries to the mailbox simulator, for emails addressed to more than one recipient, and emails addressed to recipients hosted by ISPs with which Amazon SES does not have a feedback loop agreement.

          • Aggregation (string) –

            The aggregation to apply to a metric, can be one of the following:

            • VOLUME - The volume of events for this metric.

            • RATE - The rate for this metric relative to the SEND metric volume.

      • StartDate (datetime) – [REQUIRED]

        Represents the start date for the export interval as a timestamp.

      • EndDate (datetime) – [REQUIRED]

        Represents the end date for the export interval as a timestamp.

    • MessageInsightsDataSource (dict) –

      An object that contains filters applied when performing the Message Insights export.

      • StartDate (datetime) – [REQUIRED]

        Represents the start date for the export interval as a timestamp. The start date is inclusive.

      • EndDate (datetime) – [REQUIRED]

        Represents the end date for the export interval as a timestamp. The end date is inclusive.

      • Include (dict) –

        Filters for results to be included in the export file.

        • FromEmailAddress (list) –

          The from address used to send the message.

          • (string) –

        • Destination (list) –

          The recipient’s email address.

          • (string) –

        • Subject (list) –

          The subject line of the message.

          • (string) –

        • Isp (list) –

          The recipient’s ISP (e.g., Gmail, Yahoo, etc.).

          • (string) –

        • LastDeliveryEvent (list) –

          The last delivery-related event for the email, where the ordering is as follows: SEND < BOUNCE < DELIVERY < COMPLAINT.

          • (string) –

            The type of delivery events:

            • SEND - The send request was successful and SES will attempt to deliver the message to the recipient’s mail server. (If account-level or global suppression is being used, SES will still count it as a send, but delivery is suppressed.)

            • DELIVERY - SES successfully delivered the email to the recipient’s mail server. Excludes deliveries to the mailbox simulator and emails addressed to more than one recipient.

            • TRANSIENT_BOUNCE - Feedback received for delivery failures excluding issues with non-existent mailboxes. Excludes bounces from the mailbox simulator, and those from emails addressed to more than one recipient.

            • PERMANENT_BOUNCE - Feedback received for emails sent to non-existent mailboxes. Excludes bounces from the mailbox simulator, those originating from your account-level suppression list (if enabled), and those from emails addressed to more than one recipient.

            • UNDETERMINED_BOUNCE - SES was unable to determine the bounce reason.

            • COMPLAINT - Complaint received for the email. This excludes complaints from the mailbox simulator, those originating from your account-level suppression list (if enabled), and those from emails addressed to more than one recipient.

        • LastEngagementEvent (list) –

          The last engagement-related event for the email, where the ordering is as follows: OPEN < CLICK.

          Engagement events are only available if Engagement tracking is enabled.

          • (string) –

            The type of delivery events:

            • OPEN - Open event for emails including open trackers. Excludes opens for emails addressed to more than one recipient.

            • CLICK - Click event for emails including wrapped links. Excludes clicks for emails addressed to more than one recipient.

      • Exclude (dict) –

        Filters for results to be excluded from the export file.

        • FromEmailAddress (list) –

          The from address used to send the message.

          • (string) –

        • Destination (list) –

          The recipient’s email address.

          • (string) –

        • Subject (list) –

          The subject line of the message.

          • (string) –

        • Isp (list) –

          The recipient’s ISP (e.g., Gmail, Yahoo, etc.).

          • (string) –

        • LastDeliveryEvent (list) –

          The last delivery-related event for the email, where the ordering is as follows: SEND < BOUNCE < DELIVERY < COMPLAINT.

          • (string) –

            The type of delivery events:

            • SEND - The send request was successful and SES will attempt to deliver the message to the recipient’s mail server. (If account-level or global suppression is being used, SES will still count it as a send, but delivery is suppressed.)

            • DELIVERY - SES successfully delivered the email to the recipient’s mail server. Excludes deliveries to the mailbox simulator and emails addressed to more than one recipient.

            • TRANSIENT_BOUNCE - Feedback received for delivery failures excluding issues with non-existent mailboxes. Excludes bounces from the mailbox simulator, and those from emails addressed to more than one recipient.

            • PERMANENT_BOUNCE - Feedback received for emails sent to non-existent mailboxes. Excludes bounces from the mailbox simulator, those originating from your account-level suppression list (if enabled), and those from emails addressed to more than one recipient.

            • UNDETERMINED_BOUNCE - SES was unable to determine the bounce reason.

            • COMPLAINT - Complaint received for the email. This excludes complaints from the mailbox simulator, those originating from your account-level suppression list (if enabled), and those from emails addressed to more than one recipient.

        • LastEngagementEvent (list) –

          The last engagement-related event for the email, where the ordering is as follows: OPEN < CLICK.

          Engagement events are only available if Engagement tracking is enabled.

          • (string) –

            The type of delivery events:

            • OPEN - Open event for emails including open trackers. Excludes opens for emails addressed to more than one recipient.

            • CLICK - Click event for emails including wrapped links. Excludes clicks for emails addressed to more than one recipient.

      • MaxResults (integer) –

        The maximum number of results.

  • ExportDestination (dict) –

    [REQUIRED]

    The destination for the export job.

    • DataFormat (string) – [REQUIRED]

      The data format of the final export job file, can be one of the following:

      • CSV - A comma-separated values file.

      • JSON - A Json file.

    • S3Url (string) –

      An Amazon S3 pre-signed URL that points to the generated export file.

Return type:

dict

Returns:

Response Syntax

{
    'JobId': 'string'
}

Response Structure

  • (dict) –

    An HTTP 200 response if the request succeeds, or an error message if the request fails.

    • JobId (string) –

      A string that represents the export job ID.

Exceptions