Amazon Lex
Developer Guide

StartImport

Starts a job to import a resource to Amazon Lex.

Request Syntax

POST /imports/ HTTP/1.1 Content-type: application/json { "mergeStrategy": "string", "payload": blob, "resourceType": "string" }

URI Request Parameters

The request does not use any URI parameters.

Request Body

The request accepts the following data in JSON format.

mergeStrategy

Specifies the action that the StartImport operation should take when there is an existing resource with the same name.

  • FAIL_ON_CONFLICT - The import operation is stopped on the first conflict between a resource in the import file and an existing resource. The name of the resource causing the conflict is in the failureReason field of the response to the GetImport operation.

    OVERWRITE_LATEST - The import operation proceeds even if there is a conflict with an existing resource. The $LASTEST version of the existing resource is overwritten with the data from the import file.

Type: String

Valid Values: OVERWRITE_LATEST | FAIL_ON_CONFLICT

Required: Yes

payload

A zip archive in binary format. The archive should contain one file, a JSON file containing the resource to import. The resource should match the type specified in the resourceType field.

Type: Base64-encoded binary data object

Required: Yes

resourceType

Specifies the type of resource to export. Each resource also exports any resources that it depends on.

  • A bot exports dependent intents.

  • An intent exports dependent slot types.

Type: String

Valid Values: BOT | INTENT | SLOT_TYPE

Required: Yes

Response Syntax

HTTP/1.1 201 Content-type: application/json { "createdDate": number, "importId": "string", "importStatus": "string", "mergeStrategy": "string", "name": "string", "resourceType": "string" }

Response Elements

If the action is successful, the service sends back an HTTP 201 response.

The following data is returned in JSON format by the service.

createdDate

A timestamp for the date and time that the import job was requested.

Type: Timestamp

importId

The identifier for the specific import job.

Type: String

importStatus

The status of the import job. If the status is FAILED, you can get the reason for the failure using the GetImport operation.

Type: String

Valid Values: IN_PROGRESS | COMPLETE | FAILED

mergeStrategy

The action to take when there is a merge conflict.

Type: String

Valid Values: OVERWRITE_LATEST | FAIL_ON_CONFLICT

name

The name given to the import job.

Type: String

Length Constraints: Minimum length of 1. Maximum length of 100.

Pattern: [a-zA-Z_]+

resourceType

The type of resource to import.

Type: String

Valid Values: BOT | INTENT | SLOT_TYPE

Errors

BadRequestException

The request is not well formed. For example, a value is invalid or a required field is missing. Check the field values, and try again.

HTTP Status Code: 400

InternalFailureException

An internal Amazon Lex error occurred. Try your request again.

HTTP Status Code: 500

LimitExceededException

The request exceeded a limit. Try your request again.

HTTP Status Code: 429

See Also

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