StartImport - Amazon Lex

StartImport

Starts importing a bot, bot locale, or custom vocabulary from a zip archive that you uploaded to an S3 bucket.

Request Syntax

PUT /imports/ HTTP/1.1 Content-type: application/json { "filePassword": "string", "importId": "string", "mergeStrategy": "string", "resourceSpecification": { "botImportSpecification": { "botName": "string", "botTags": { "string" : "string" }, "dataPrivacy": { "childDirected": boolean }, "idleSessionTTLInSeconds": number, "roleArn": "string", "testBotAliasTags": { "string" : "string" } }, "botLocaleImportSpecification": { "botId": "string", "botVersion": "string", "localeId": "string", "nluIntentConfidenceThreshold": number, "voiceSettings": { "engine": "string", "voiceId": "string" } }, "customVocabularyImportSpecification": { "botId": "string", "botVersion": "string", "localeId": "string" } } }

URI Request Parameters

The request does not use any URI parameters.

Request Body

The request accepts the following data in JSON format.

filePassword

The password used to encrypt the zip archive that contains the resource definition. You should always encrypt the zip archive to protect it during transit between your site and Amazon Lex.

Type: String

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

Required: No

importId

The unique identifier for the import. It is included in the response from the CreateUploadUrl operation.

Type: String

Length Constraints: Fixed length of 10.

Pattern: ^[0-9a-zA-Z]+$

Required: Yes

mergeStrategy

The strategy to use when there is a name conflict between the imported resource and an existing resource. When the merge strategy is FailOnConflict existing resources are not overwritten and the import fails.

Type: String

Valid Values: Overwrite | FailOnConflict | Append

Required: Yes

resourceSpecification

Parameters for creating the bot, bot locale or custom vocabulary.

Type: ImportResourceSpecification object

Required: Yes

Response Syntax

HTTP/1.1 202 Content-type: application/json { "creationDateTime": number, "importId": "string", "importStatus": "string", "mergeStrategy": "string", "resourceSpecification": { "botImportSpecification": { "botName": "string", "botTags": { "string" : "string" }, "dataPrivacy": { "childDirected": boolean }, "idleSessionTTLInSeconds": number, "roleArn": "string", "testBotAliasTags": { "string" : "string" } }, "botLocaleImportSpecification": { "botId": "string", "botVersion": "string", "localeId": "string", "nluIntentConfidenceThreshold": number, "voiceSettings": { "engine": "string", "voiceId": "string" } }, "customVocabularyImportSpecification": { "botId": "string", "botVersion": "string", "localeId": "string" } } }

Response Elements

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

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

creationDateTime

The date and time that the import request was created.

Type: Timestamp

importId

A unique identifier for the import.

Type: String

Length Constraints: Fixed length of 10.

Pattern: ^[0-9a-zA-Z]+$

importStatus

The current status of the import. When the status is Complete the bot, bot alias, or custom vocabulary is ready to use.

Type: String

Valid Values: InProgress | Completed | Failed | Deleting

mergeStrategy

The strategy used when there was a name conflict between the imported resource and an existing resource. When the merge strategy is FailOnConflict existing resources are not overwritten and the import fails.

Type: String

Valid Values: Overwrite | FailOnConflict | Append

resourceSpecification

The parameters used when importing the resource.

Type: ImportResourceSpecification object

Errors

For information about the errors that are common to all actions, see Common Errors.

ConflictException

The action that you tried to perform couldn't be completed because the resource is in a conflicting state. For example, deleting a bot that is in the CREATING state. Try your request again.

HTTP Status Code: 409

InternalServerException

The service encountered an unexpected condition. Try your request again.

HTTP Status Code: 500

ResourceNotFoundException

You asked to describe a resource that doesn't exist. Check the resource that you are requesting and try again.

HTTP Status Code: 404

ServiceQuotaExceededException

You have reached a quota for your bot.

HTTP Status Code: 402

ThrottlingException

Your request rate is too high. Reduce the frequency of requests.

HTTP Status Code: 429

ValidationException

One of the input parameters in your request isn't valid. Check the parameters and try your request again.

HTTP Status Code: 400

See Also

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