StartImport - Amazon Lex V1

If you are using Amazon Lex V2, refer to the Amazon Lex V2 guide instead.

 

If you are using Amazon Lex V1, we recommend upgrading your bots to Amazon Lex V2. We are no longer adding new features to V1 and strongly recommend using V2 for all new bots.

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", "tags": [ { "key": "string", "value": "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

tags

A list of tags to add to the imported bot. You can only add tags when you import a bot, you can't add tags to an intent or slot type.

Type: Array of Tag objects

Array Members: Minimum number of 0 items. Maximum number of 200 items.

Required: No

Response Syntax

HTTP/1.1 201 Content-type: application/json { "createdDate": number, "importId": "string", "importStatus": "string", "mergeStrategy": "string", "name": "string", "resourceType": "string", "tags": [ { "key": "string", "value": "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

tags

A list of tags added to the imported bot.

Type: Array of Tag objects

Array Members: Minimum number of 0 items. Maximum number of 200 items.

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: