Import Jobs - Amazon Pinpoint

Import Jobs

The Import Jobs resource represents jobs that import endpoint definitions from one or more files. The files can be stored in an Amazon Simple Storage Service (Amazon S3) bucket or uploaded directly from a computer by using the Amazon Pinpoint console.

An endpoint uniquely identifies a mobile device, email address, or phone number that can receive a message. Importing endpoint definitions is useful if you've already created user segments outside Amazon Pinpoint but you want to engage your users with Amazon Pinpoint campaigns. By using an import job, you can import the endpoint definitions for those users and create a segment that contains all the imported data.

You can use the Import Jobs resource to create or retrieve information about the import jobs for an application. This includes checking the status of an in-progress import job and retrieving information about all the import jobs for an application.

URI

/v1/apps/application-id/jobs/import

HTTP methods

GET

Operation ID: GetImportJobs

Retrieves information about the status and settings of all the import jobs for an application.

Path parameters
Name Type Required Description
application-id String True

The unique identifier for the application. This identifier is displayed as the Project ID on the Amazon Pinpoint console.

Header parameters
Name Type Required Description
accept String False

Indicates which content types, expressed as MIME types, the client understands.

Query parameters
Name Type Required Description
page-size String False

The maximum number of items to include in each page of a paginated response. This parameter is not supported for application, campaign, and journey metrics.

token String False

The NextToken string that specifies which page of results to return in a paginated response.

Responses
Status code Response model Description
200 ImportJobsResponse

The request succeeded.

400 MessageBody

The request contains a syntax error (BadRequestException).

403 MessageBody

The request was denied because access to the specified resource is forbidden (ForbiddenException).

404 MessageBody

The request failed because the specified resource was not found (NotFoundException).

405 MessageBody

The request failed because the method is not allowed for the specified resource (MethodNotAllowedException).

413 MessageBody

The request failed because the payload for the body of the request is too large (RequestEntityTooLargeException).

429 MessageBody

The request failed because too many requests were sent during a certain amount of time (TooManyRequestsException).

500 MessageBody

The request failed due to an unknown internal server error, exception, or failure (InternalServerErrorException).

POST

Operation ID: CreateImportJob

Creates an import job for an application.

Path parameters
Name Type Required Description
application-id String True

The unique identifier for the application. This identifier is displayed as the Project ID on the Amazon Pinpoint console.

Header parameters
Name Type Required Description
accept String False

Indicates which content types, expressed as MIME types, the client understands.

Responses
Status code Response model Description
201 ImportJobResponse

The request succeeded and the specified resource was created.

400 MessageBody

The request contains a syntax error (BadRequestException).

403 MessageBody

The request was denied because access to the specified resource is forbidden (ForbiddenException).

404 MessageBody

The request failed because the specified resource was not found (NotFoundException).

405 MessageBody

The request failed because the method is not allowed for the specified resource (MethodNotAllowedException).

413 MessageBody

The request failed because the payload for the body of the request is too large (RequestEntityTooLargeException).

429 MessageBody

The request failed because too many requests were sent during a certain amount of time (TooManyRequestsException).

500 MessageBody

The request failed due to an unknown internal server error, exception, or failure (InternalServerErrorException).

OPTIONS

Retrieves information about the communication requirements and options that are available for the Import Jobs resource.

Path parameters
Name Type Required Description
application-id String True

The unique identifier for the application. This identifier is displayed as the Project ID on the Amazon Pinpoint console.

Responses
Status code Response model Description
200 None

The request succeeded.

Schemas

Request bodies

{ "S3Url": "string", "RoleArn": "string", "ExternalId": "string", "Format": enum, "RegisterEndpoints": boolean, "DefineSegment": boolean, "SegmentName": "string", "SegmentId": "string" }

Response bodies

{ "Item": [ { "ApplicationId": "string", "Id": "string", "JobStatus": enum, "CompletedPieces": integer, "FailedPieces": integer, "TotalPieces": integer, "CreationDate": "string", "CompletionDate": "string", "Type": "string", "TotalFailures": integer, "TotalProcessed": integer, "Failures": [ "string" ], "Definition": { "S3Url": "string", "RoleArn": "string", "ExternalId": "string", "Format": enum, "RegisterEndpoints": boolean, "DefineSegment": boolean, "SegmentName": "string", "SegmentId": "string" } } ], "NextToken": "string" }
{ "ApplicationId": "string", "Id": "string", "JobStatus": enum, "CompletedPieces": integer, "FailedPieces": integer, "TotalPieces": integer, "CreationDate": "string", "CompletionDate": "string", "Type": "string", "TotalFailures": integer, "TotalProcessed": integer, "Failures": [ "string" ], "Definition": { "S3Url": "string", "RoleArn": "string", "ExternalId": "string", "Format": enum, "RegisterEndpoints": boolean, "DefineSegment": boolean, "SegmentName": "string", "SegmentId": "string" } }
{ "RequestID": "string", "Message": "string" }

Properties

ImportJobRequest

Specifies the settings for a job that imports endpoint definitions from an Amazon Simple Storage Service (Amazon S3) bucket.

Property Type Required Description
DefineSegment

boolean

False

Specifies whether to create a segment that contains the endpoints, when the endpoint definitions are imported.

ExternalId

string

False

(Deprecated) Your AWS account ID, which you assigned to an external ID key in an IAM trust policy. Amazon Pinpoint previously used this value to assume an IAM role when importing endpoint definitions, but we removed this requirement. We don't recommend use of external IDs for IAM roles that are assumed by Amazon Pinpoint.

Format

string

Values: CSV | JSON

True

The format of the files that contain the endpoint definitions to import. Valid values are: CSV, for comma-separated values format; and, JSON, for newline-delimited JSON format. If the Amazon S3 location stores multiple files that use different formats, Amazon Pinpoint imports data only from the files that use the specified format.

RegisterEndpoints

boolean

False

Specifies whether to register the endpoints with Amazon Pinpoint, when the endpoint definitions are imported.

RoleArn

string

True

The Amazon Resource Name (ARN) of the AWS Identity and Access Management (IAM) role that authorizes Amazon Pinpoint to access the Amazon S3 location to import endpoint definitions from.

S3Url

string

True

The URL of the Amazon Simple Storage Service (Amazon S3) bucket that contains the endpoint definitions to import. This location can be a folder or a single file. If the location is a folder, Amazon Pinpoint imports endpoint definitions from the files in this location, including any subfolders that the folder contains.

The URL should be in the following format: s3://bucket-name/folder-name/file-name. The location can end with the key for an individual object or a prefix that qualifies multiple objects.

SegmentId

string

False

The identifier for the segment to update or add the imported endpoint definitions to, if the import job is meant to update an existing segment.

SegmentName

string

False

A custom name for the segment that's created by the import job, if the value of the DefineSegment property is true.

ImportJobResource

Provides information about the resource settings for a job that imports endpoint definitions from one or more files. The files can be stored in an Amazon Simple Storage Service (Amazon S3) bucket or uploaded directly from a computer by using the Amazon Pinpoint console.

Property Type Required Description
DefineSegment

boolean

False

Specifies whether the import job creates a segment that contains the endpoints, when the endpoint definitions are imported.

ExternalId

string

False

(Deprecated) Your AWS account ID, which you assigned to an external ID key in an IAM trust policy. Amazon Pinpoint previously used this value to assume an IAM role when importing endpoint definitions, but we removed this requirement. We don't recommend use of external IDs for IAM roles that are assumed by Amazon Pinpoint.

Format

string

Values: CSV | JSON

True

The format of the files that contain the endpoint definitions to import. Valid values are: CSV, for comma-separated values format; and, JSON, for newline-delimited JSON format.

If the files are stored in an Amazon S3 location and that location contains multiple files that use different formats, Amazon Pinpoint imports data only from the files that use the specified format.

RegisterEndpoints

boolean

False

Specifies whether the import job registers the endpoints with Amazon Pinpoint, when the endpoint definitions are imported.

RoleArn

string

True

The Amazon Resource Name (ARN) of the AWS Identity and Access Management (IAM) role that authorizes Amazon Pinpoint to access the Amazon S3 location to import endpoint definitions from.

S3Url

string

True

The URL of the Amazon Simple Storage Service (Amazon S3) bucket that contains the endpoint definitions to import. This location can be a folder or a single file. If the location is a folder, Amazon Pinpoint imports endpoint definitions from the files in this location, including any subfolders that the folder contains.

The URL should be in the following format: s3://bucket-name/folder-name/file-name. The location can end with the key for an individual object or a prefix that qualifies multiple objects.

SegmentId

string

False

The identifier for the segment that the import job updates or adds endpoint definitions to, if the import job updates an existing segment.

SegmentName

string

False

The custom name for the segment that's created by the import job, if the value of the DefineSegment property is true.

ImportJobResponse

Provides information about the status and settings of a job that imports endpoint definitions from one or more files. The files can be stored in an Amazon Simple Storage Service (Amazon S3) bucket or uploaded directly from a computer by using the Amazon Pinpoint console.

Property Type Required Description
ApplicationId

string

True

The unique identifier for the application that's associated with the import job.

CompletedPieces

integer

False

The number of pieces that were processed successfully (completed) by the import job, as of the time of the request.

CompletionDate

string

False

The date, in ISO 8601 format, when the import job was completed.

CreationDate

string

True

The date, in ISO 8601 format, when the import job was created.

Definition

ImportJobResource

True

The resource settings that apply to the import job.

FailedPieces

integer

False

The number of pieces that weren't processed successfully (failed) by the import job, as of the time of the request.

Failures

Array of type string

False

An array of entries, one for each of the first 100 entries that weren't processed successfully (failed) by the import job, if any.

Id

string

True

The unique identifier for the import job.

JobStatus

string

Values: CREATED | PREPARING_FOR_INITIALIZATION | INITIALIZING | PROCESSING | PENDING_JOB | COMPLETING | COMPLETED | CANCELLING | CANCELLED | FAILING | FAILED

True

The status of the import job. The job status is FAILED if Amazon Pinpoint wasn't able to process one or more pieces in the job.

TotalFailures

integer

False

The total number of endpoint definitions that weren't processed successfully (failed) by the import job, typically because an error, such as a syntax error, occurred.

TotalPieces

integer

False

The total number of pieces that must be processed to complete the import job. Each piece consists of an approximately equal portion of the endpoint definitions that are part of the import job.

TotalProcessed

integer

False

The total number of endpoint definitions that were processed by the import job.

Type

string

True

The job type. This value is IMPORT for import jobs.

ImportJobsResponse

Provides information about the status and settings of all the import jobs that are associated with an application or segment. An import job is a job that imports endpoint definitions from one or more files.

Property Type Required Description
Item

Array of type ImportJobResponse

True

An array of responses, one for each import job that's associated with the application (Import Jobs resource) or segment (Segment Import Jobs resource).

NextToken

string

False

The string to use in a subsequent request to get the next page of results in a paginated response. This value is null if there are no additional pages.

MessageBody

Provides information about an API request or response.

Property Type Required Description
Message

string

False

The message that's returned from the API.

RequestID

string

False

The unique identifier for the request or response.

See also

For more information about using this API in one of the language-specific AWS SDKs and references, see the following:

GetImportJobs

CreateImportJob