Amazon Simple Email Service

2023/08/29 - Amazon Simple Email Service - 5 new 2 updated api methods

Changes  Adds support for the new Export and Message Insights features: create, get, list and cancel export jobs; get message insights.

GetMessageInsights (new) Link ¶

Provides information about a specific message, including the from address, the subject, the recipient address, email tags, as well as events associated with the message.

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

See also: AWS API Documentation

Request Syntax

client.get_message_insights(
    MessageId='string'
)
type MessageId

string

param MessageId

[REQUIRED]

A MessageId is a unique identifier for a message, and is returned when sending emails through Amazon SES.

rtype

dict

returns

Response Syntax

{
    'MessageId': 'string',
    'FromEmailAddress': 'string',
    'Subject': 'string',
    'EmailTags': [
        {
            'Name': 'string',
            'Value': 'string'
        },
    ],
    'Insights': [
        {
            'Destination': 'string',
            'Isp': 'string',
            'Events': [
                {
                    'Timestamp': datetime(2015, 1, 1),
                    'Type': 'SEND'|'REJECT'|'BOUNCE'|'COMPLAINT'|'DELIVERY'|'OPEN'|'CLICK'|'RENDERING_FAILURE'|'DELIVERY_DELAY'|'SUBSCRIPTION',
                    'Details': {
                        'Bounce': {
                            'BounceType': 'UNDETERMINED'|'TRANSIENT'|'PERMANENT',
                            'BounceSubType': 'string',
                            'DiagnosticCode': 'string'
                        },
                        'Complaint': {
                            'ComplaintSubType': 'string',
                            'ComplaintFeedbackType': 'string'
                        }
                    }
                },
            ]
        },
    ]
}

Response Structure

  • (dict) --

    Information about a message.

    • MessageId (string) --

      A unique identifier for the message.

    • FromEmailAddress (string) --

      The from address used to send the message.

    • Subject (string) --

      The subject line of the message.

    • EmailTags (list) --

      A list of tags, in the form of name/value pairs, that were applied to the email you sent, along with Amazon SES Auto-Tags.

      • (dict) --

        Contains the name and value of a tag that you apply to an email. You can use message tags when you publish email sending events.

        • Name (string) --

          The name of the message tag. The message tag name has to meet the following criteria:

          • It can only contain ASCII letters (a–z, A–Z), numbers (0–9), underscores (_), or dashes (-).

          • It can contain no more than 256 characters.

        • Value (string) --

          The value of the message tag. The message tag value has to meet the following criteria:

          • It can only contain ASCII letters (a–z, A–Z), numbers (0–9), underscores (_), or dashes (-).

          • It can contain no more than 256 characters.

    • Insights (list) --

      A set of insights associated with the message.

      • (dict) --

        An email's insights contain metadata and delivery information about a specific email.

        • Destination (string) --

          The recipient of the email.

        • Isp (string) --

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

        • Events (list) --

          A list of events associated with the sent email.

          • (dict) --

            An object containing details about a specific event.

            • Timestamp (datetime) --

              The timestamp of the event.

            • Type (string) --

              The type of event:

              • 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 those from emails addressed to more than one recipient.

              • BOUNCE - Feedback received for delivery failures. Additional details about the bounce are provided in the Details object. Excludes bounces from the mailbox simulator, and those from emails addressed to more than one recipient.

              • COMPLAINT - Complaint received for the email. Additional details about the complaint are provided in the Details object. 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.

              • 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.

            • Details (dict) --

              Details about bounce or complaint events.

              • Bounce (dict) --

                Information about a Bounce event.

                • BounceType (string) --

                  The type of the bounce, as determined by SES. Can be one of UNDETERMINED , TRANSIENT , or PERMANENT

                • BounceSubType (string) --

                  The subtype of the bounce, as determined by SES.

                • DiagnosticCode (string) --

                  The status code issued by the reporting Message Transfer Authority (MTA). This field only appears if a delivery status notification (DSN) was attached to the bounce and the Diagnostic-Code was provided in the DSN.

              • Complaint (dict) --

                Information about a Complaint event.

                • ComplaintSubType (string) --

                  Can either be null or OnAccountSuppressionList . If the value is OnAccountSuppressionList , SES accepted the message, but didn't attempt to send it because it was on the account-level suppression list.

                • ComplaintFeedbackType (string) --

                  The value of the Feedback-Type field from the feedback report received from the ISP.

CancelExportJob (new) Link ¶

Cancels an export job.

See also: AWS API Documentation

Request Syntax

client.cancel_export_job(
    JobId='string'
)
type JobId

string

param JobId

[REQUIRED]

The export job ID.

rtype

dict

returns

Response Syntax

{}

Response Structure

  • (dict) --

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

GetExportJob (new) Link ¶

Provides information about an export job.

See also: AWS API Documentation

Request Syntax

client.get_export_job(
    JobId='string'
)
type JobId

string

param JobId

[REQUIRED]

The export job ID.

rtype

dict

returns

Response Syntax

{
    'JobId': 'string',
    'ExportSourceType': 'METRICS_DATA'|'MESSAGE_INSIGHTS',
    'JobStatus': 'CREATED'|'PROCESSING'|'COMPLETED'|'FAILED'|'CANCELLED',
    'ExportDestination': {
        'DataFormat': 'CSV'|'JSON',
        'S3Url': 'string'
    },
    '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
        }
    },
    'CreatedTimestamp': datetime(2015, 1, 1),
    'CompletedTimestamp': datetime(2015, 1, 1),
    'FailureInfo': {
        'FailedRecordsS3Url': 'string',
        'ErrorMessage': 'string'
    },
    'Statistics': {
        'ProcessedRecordsCount': 123,
        'ExportedRecordsCount': 123
    }
}

Response Structure

  • (dict) --

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

    • JobId (string) --

      The export job ID.

    • ExportSourceType (string) --

      The type of source of the export job.

    • JobStatus (string) --

      The status of the export job.

    • ExportDestination (dict) --

      The destination of the export job.

      • DataFormat (string) --

        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.

    • ExportDataSource (dict) --

      The data source of the export job.

      • MetricsDataSource (dict) --

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

        • Dimensions (dict) --

          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) --

          The metrics namespace - e.g., VDM .

        • Metrics (list) --

          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) --

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

        • EndDate (datetime) --

          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) --

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

        • EndDate (datetime) --

          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.

    • CreatedTimestamp (datetime) --

      The timestamp of when the export job was created.

    • CompletedTimestamp (datetime) --

      The timestamp of when the export job was completed.

    • FailureInfo (dict) --

      The failure details about an export job.

      • FailedRecordsS3Url (string) --

        An Amazon S3 pre-signed URL that contains all the failed records and related information.

      • ErrorMessage (string) --

        A message about why the job failed.

    • Statistics (dict) --

      The statistics about the export job.

      • ProcessedRecordsCount (integer) --

        The number of records that were processed to generate the final export file.

      • ExportedRecordsCount (integer) --

        The number of records that were exported to the final export file.

        This value might not be available for all export source types

ListExportJobs (new) Link ¶

Lists all of the export jobs.

See also: AWS API Documentation

Request Syntax

client.list_export_jobs(
    NextToken='string',
    PageSize=123,
    ExportSourceType='METRICS_DATA'|'MESSAGE_INSIGHTS',
    JobStatus='CREATED'|'PROCESSING'|'COMPLETED'|'FAILED'|'CANCELLED'
)
type NextToken

string

param NextToken

The pagination token returned from a previous call to ListExportJobs to indicate the position in the list of export jobs.

type PageSize

integer

param PageSize

Maximum number of export jobs to return at once. Use this parameter to paginate results. If additional export jobs exist beyond the specified limit, the NextToken element is sent in the response. Use the NextToken value in subsequent calls to ListExportJobs to retrieve additional export jobs.

type ExportSourceType

string

param ExportSourceType

A value used to list export jobs that have a certain ExportSourceType .

type JobStatus

string

param JobStatus

A value used to list export jobs that have a certain JobStatus .

rtype

dict

returns

Response Syntax

{
    'ExportJobs': [
        {
            'JobId': 'string',
            'ExportSourceType': 'METRICS_DATA'|'MESSAGE_INSIGHTS',
            'JobStatus': 'CREATED'|'PROCESSING'|'COMPLETED'|'FAILED'|'CANCELLED',
            'CreatedTimestamp': datetime(2015, 1, 1),
            'CompletedTimestamp': datetime(2015, 1, 1)
        },
    ],
    'NextToken': 'string'
}

Response Structure

  • (dict) --

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

    • ExportJobs (list) --

      A list of the export job summaries.

      • (dict) --

        A summary of the export job.

        • JobId (string) --

          The export job ID.

        • ExportSourceType (string) --

          The source type of the export job.

        • JobStatus (string) --

          The status of the export job.

        • CreatedTimestamp (datetime) --

          The timestamp of when the export job was created.

        • CompletedTimestamp (datetime) --

          The timestamp of when the export job was completed.

    • NextToken (string) --

      A string token indicating that there might be additional export jobs available to be listed. Use this token to a subsequent call to ListExportJobs with the same parameters to retrieve the next page of export jobs.

CreateExportJob (new) Link ¶

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

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'
    }
)
type ExportDataSource

dict

param ExportDataSource

[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.

type ExportDestination

dict

param ExportDestination

[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.

rtype

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.

GetImportJob (updated) Link ¶
Changes (response)
{'JobStatus': {'CANCELLED'}}

Provides information about an import job.

See also: AWS API Documentation

Request Syntax

client.get_import_job(
    JobId='string'
)
type JobId

string

param JobId

[REQUIRED]

The ID of the import job.

rtype

dict

returns

Response Syntax

{
    'JobId': 'string',
    'ImportDestination': {
        'SuppressionListDestination': {
            'SuppressionListImportAction': 'DELETE'|'PUT'
        },
        'ContactListDestination': {
            'ContactListName': 'string',
            'ContactListImportAction': 'DELETE'|'PUT'
        }
    },
    'ImportDataSource': {
        'S3Url': 'string',
        'DataFormat': 'CSV'|'JSON'
    },
    'FailureInfo': {
        'FailedRecordsS3Url': 'string',
        'ErrorMessage': 'string'
    },
    'JobStatus': 'CREATED'|'PROCESSING'|'COMPLETED'|'FAILED'|'CANCELLED',
    'CreatedTimestamp': datetime(2015, 1, 1),
    'CompletedTimestamp': datetime(2015, 1, 1),
    'ProcessedRecordsCount': 123,
    'FailedRecordsCount': 123
}

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 import job ID.

    • ImportDestination (dict) --

      The destination of the import job.

      • SuppressionListDestination (dict) --

        An object that contains the action of the import job towards suppression list.

        • SuppressionListImportAction (string) --

          The type of action to perform on the address. The following are possible values:

          • PUT: add the addresses to the suppression list. If the record already exists, it will override it with the new value.

          • DELETE: remove the addresses from the suppression list.

      • ContactListDestination (dict) --

        An object that contains the action of the import job towards a contact list.

        • ContactListName (string) --

          The name of the contact list.

        • ContactListImportAction (string) --

          >The type of action to perform on the addresses. The following are the possible values:

          • PUT: add the addresses to the contact list. If the record already exists, it will override it with the new value.

          • DELETE: remove the addresses from the contact list.

    • ImportDataSource (dict) --

      The data source of the import job.

      • S3Url (string) --

        An Amazon S3 URL in the format s3://<bucket_name> /<object> .

      • DataFormat (string) --

        The data format of the import job's data source.

    • FailureInfo (dict) --

      The failure details about an import job.

      • FailedRecordsS3Url (string) --

        An Amazon S3 pre-signed URL that contains all the failed records and related information.

      • ErrorMessage (string) --

        A message about why the job failed.

    • JobStatus (string) --

      The status of the import job.

    • CreatedTimestamp (datetime) --

      The time stamp of when the import job was created.

    • CompletedTimestamp (datetime) --

      The time stamp of when the import job was completed.

    • ProcessedRecordsCount (integer) --

      The current number of records processed.

    • FailedRecordsCount (integer) --

      The number of records that failed processing because of invalid input or other reasons.

ListImportJobs (updated) Link ¶
Changes (response)
{'ImportJobs': {'JobStatus': {'CANCELLED'}}}

Lists all of the import jobs.

See also: AWS API Documentation

Request Syntax

client.list_import_jobs(
    ImportDestinationType='SUPPRESSION_LIST'|'CONTACT_LIST',
    NextToken='string',
    PageSize=123
)
type ImportDestinationType

string

param ImportDestinationType

The destination of the import job, which can be used to list import jobs that have a certain ImportDestinationType .

type NextToken

string

param NextToken

A string token indicating that there might be additional import jobs available to be listed. Copy this token to a subsequent call to ListImportJobs with the same parameters to retrieve the next page of import jobs.

type PageSize

integer

param PageSize

Maximum number of import jobs to return at once. Use this parameter to paginate results. If additional import jobs exist beyond the specified limit, the NextToken element is sent in the response. Use the NextToken value in subsequent requests to retrieve additional addresses.

rtype

dict

returns

Response Syntax

{
    'ImportJobs': [
        {
            'JobId': 'string',
            'ImportDestination': {
                'SuppressionListDestination': {
                    'SuppressionListImportAction': 'DELETE'|'PUT'
                },
                'ContactListDestination': {
                    'ContactListName': 'string',
                    'ContactListImportAction': 'DELETE'|'PUT'
                }
            },
            'JobStatus': 'CREATED'|'PROCESSING'|'COMPLETED'|'FAILED'|'CANCELLED',
            'CreatedTimestamp': datetime(2015, 1, 1),
            'ProcessedRecordsCount': 123,
            'FailedRecordsCount': 123
        },
    ],
    'NextToken': 'string'
}

Response Structure

  • (dict) --

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

    • ImportJobs (list) --

      A list of the import job summaries.

      • (dict) --

        A summary of the import job.

        • JobId (string) --

          A string that represents a job ID.

        • ImportDestination (dict) --

          An object that contains details about the resource destination the import job is going to target.

          • SuppressionListDestination (dict) --

            An object that contains the action of the import job towards suppression list.

            • SuppressionListImportAction (string) --

              The type of action to perform on the address. The following are possible values:

              • PUT: add the addresses to the suppression list. If the record already exists, it will override it with the new value.

              • DELETE: remove the addresses from the suppression list.

          • ContactListDestination (dict) --

            An object that contains the action of the import job towards a contact list.

            • ContactListName (string) --

              The name of the contact list.

            • ContactListImportAction (string) --

              >The type of action to perform on the addresses. The following are the possible values:

              • PUT: add the addresses to the contact list. If the record already exists, it will override it with the new value.

              • DELETE: remove the addresses from the contact list.

        • JobStatus (string) --

          The status of a job.

          • CREATED – Job has just been created.

          • PROCESSING – Job is processing.

          • ERROR – An error occurred during processing.

          • COMPLETED – Job has completed processing successfully.

        • CreatedTimestamp (datetime) --

          The date and time when the import job was created.

        • ProcessedRecordsCount (integer) --

          The current number of records processed.

        • FailedRecordsCount (integer) --

          The number of records that failed processing because of invalid input or other reasons.

    • NextToken (string) --

      A string token indicating that there might be additional import jobs available to be listed. Copy this token to a subsequent call to ListImportJobs with the same parameters to retrieve the next page of import jobs.