Amazon Simple Email Service

2020/08/18 - Amazon Simple Email Service - 3 new api methods

Changes  This release includes new APIs to allow customers to add or remove email addresses from their account-level suppression list in bulk.

ListImportJobs (new) Link ¶

Lists all of the import jobs.

See also: AWS API Documentation

Request Syntax

client.list_import_jobs(
    ImportDestinationType='SUPPRESSION_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'
                }
            },
            'JobStatus': 'CREATED'|'PROCESSING'|'COMPLETED'|'FAILED',
            'CreatedTimestamp': 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.

    • ImportJobs (list) --

      A list of the import job summaries.

      • (dict) --

        A summary of the import job.

        • JobId (string) --

          A string that represents the import 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 that you want to perform on the address. Acceptable 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.

        • JobStatus (string) --

          The status of the import job.

        • CreatedTimestamp (datetime) --

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

CreateImportJob (new) Link ¶

Creates an import job for a data destination.

See also: AWS API Documentation

Request Syntax

client.create_import_job(
    ImportDestination={
        'SuppressionListDestination': {
            'SuppressionListImportAction': 'DELETE'|'PUT'
        }
    },
    ImportDataSource={
        'S3Url': 'string',
        'DataFormat': 'CSV'|'JSON'
    }
)
type ImportDestination

dict

param ImportDestination

[REQUIRED]

The destination for the import job.

  • SuppressionListDestination (dict) -- [REQUIRED]

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

    • SuppressionListImportAction (string) -- [REQUIRED]

      The type of action that you want to perform on the address. Acceptable 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.

type ImportDataSource

dict

param ImportDataSource

[REQUIRED]

The data source for the import job.

  • S3Url (string) -- [REQUIRED]

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

  • DataFormat (string) -- [REQUIRED]

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

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

GetImportJob (new) Link ¶

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'
        }
    },
    'ImportDataSource': {
        'S3Url': 'string',
        'DataFormat': 'CSV'|'JSON'
    },
    'FailureInfo': {
        'FailedRecordsS3Url': 'string',
        'ErrorMessage': 'string'
    },
    'JobStatus': 'CREATED'|'PROCESSING'|'COMPLETED'|'FAILED',
    '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 that you want to perform on the address. Acceptable 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.

    • 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 presigned URL that contains all the failed records and related information.

      • ErrorMessage (string) --

        A message about why the import 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.