{ "swagger": "2.0", "schemes": [ "http" ], "host": "runtime.lex.amazonaws.com", "basePath": "/", "info": { "contact": { "email": "mike.ralphson@gmail.com", "name": "Mike Ralphson", "url": "https://github.com/mermade/aws2openapi" }, "description": "Amazon Lex provides both build and runtime endpoints. Each endpoint provides a set of operations (API). Your conversational bot uses the runtime API to understand user utterances (user input text or voice). For example, suppose a user says \"I want pizza\", your bot sends this input to Amazon Lex using the runtime API. Amazon Lex recognizes that the user request is for the OrderPizza intent (one of the intents defined in the bot). Then Amazon Lex engages in user conversation on behalf of the bot to elicit required information (slot values, such as pizza size and crust type), and then performs fulfillment activity (that you configured when you created the bot). You use the build-time API to create and manage your Amazon Lex bot. For a list of build-time operations, see the build-time API, . ", "license": { "name": "Apache 2.0 License", "url": "http://www.apache.org/licenses/" }, "termsOfService": "https://aws.amazon.com/service-terms/", "title": "Amazon Lex Runtime Service", "version": "2016-11-28", "x-apiClientRegistration": { "url": "https://portal.aws.amazon.com/gp/aws/developer/registration/index.html?nc2=h_ct" }, "x-apisguru-categories": [ "cloud" ], "x-logo": { "backgroundColor": "#FFFFFF", "url": "https://api.apis.guru/v2/cache/logo/https_media.amazonwebservices.com_blog_2007_big_pbaws_logo_300px.jpg" }, "x-origin": [ { "contentType": "application/json", "converter": { "url": "https://github.com/mermade/aws2openapi", "version": "1.0.0" }, "url": "https://raw.githubusercontent.com/aws/aws-sdk-js/master/apis/runtime.lex-2016-11-28.normal.json", "x-apisguru-direct": true } ], "x-preferred": true, "x-providerName": "amazonaws.com", "x-release": "v4", "x-serviceName": "runtime.lex" }, "externalDocs": { "description": "Amazon Web Services documentation", "url": "https://aws.amazon.com/lex/" }, "consumes": [ "application/json" ], "produces": [ "application/json" ], "securityDefinitions": { "hmac": { "description": "Amazon Signature authorization v4", "in": "header", "name": "Authorization", "type": "apiKey", "x-amazon-apigateway-authtype": "awsSigv4" } }, "security": [ { "hmac": [] } ], "parameters": { "Action": { "in": "header", "name": "Action", "required": true, "type": "string" }, "Version": { "in": "header", "name": "Version", "required": true, "type": "string" }, "X-Amz-Algorithm": { "in": "header", "name": "X-Amz-Algorithm", "required": false, "type": "string" }, "X-Amz-Content-Sha256": { "in": "header", "name": "X-Amz-Content-Sha256", "required": false, "type": "string" }, "X-Amz-Credential": { "in": "header", "name": "X-Amz-Credential", "required": false, "type": "string" }, "X-Amz-Date": { "in": "header", "name": "X-Amz-Date", "required": false, "type": "string" }, "X-Amz-Security-Token": { "in": "header", "name": "X-Amz-Security-Token", "required": false, "type": "string" }, "X-Amz-Signature": { "in": "header", "name": "X-Amz-Signature", "required": false, "type": "string" }, "X-Amz-SignedHeaders": { "in": "header", "name": "X-Amz-SignedHeaders", "required": false, "type": "string" } }, "paths": { "/bot/{botName}/alias/{botAlias}/user/{userId}/content": { "parameters": [ { "$ref": "#/parameters/Action" }, { "$ref": "#/parameters/Version" }, { "$ref": "#/parameters/X-Amz-Content-Sha256" }, { "$ref": "#/parameters/X-Amz-Date" }, { "$ref": "#/parameters/X-Amz-Algorithm" }, { "$ref": "#/parameters/X-Amz-Credential" }, { "$ref": "#/parameters/X-Amz-Security-Token" }, { "$ref": "#/parameters/X-Amz-Signature" }, { "$ref": "#/parameters/X-Amz-SignedHeaders" } ], "post": { "description": "
Sends user input (text or speech) to Amazon Lex. Clients use this API to send text and audio requests to Amazon Lex at runtime. Amazon Lex interprets the user input using the machine learning model that it built for the bot.
The PostContent operation supports audio input at 8kHz and 16kHz. You can use 8kHz audio to achieve higher speech recognition accuracy in telephone audio applications.
In response, Amazon Lex returns the next message to convey to the user. Consider the following example messages:
For a user input \"I would like a pizza,\" Amazon Lex might return a response with a message eliciting slot data (for example, PizzaSize): \"What size pizza would you like?\".
After the user provides all of the pizza order information, Amazon Lex might return a response with a message to get user confirmation: \"Order the pizza?\".
After the user replies \"Yes\" to the confirmation prompt, Amazon Lex might return a conclusion statement: \"Thank you, your cheese pizza has been ordered.\".
Not all Amazon Lex messages require a response from the user. For example, conclusion statements do not require a response. Some messages require only a yes or no response. In addition to the message, Amazon Lex provides additional context about the message in the response that you can use to enhance client behavior, such as displaying the appropriate client user interface. Consider the following examples:
If the message is to elicit slot data, Amazon Lex returns the following context information:
x-amz-lex-dialog-state header set to ElicitSlot
x-amz-lex-intent-name header set to the intent name in the current context
x-amz-lex-slot-to-elicit header set to the slot name for which the message is eliciting information
x-amz-lex-slots header set to a map of slots configured for the intent with their current values
If the message is a confirmation prompt, the x-amz-lex-dialog-state header is set to Confirmation and the x-amz-lex-slot-to-elicit header is omitted.
If the message is a clarification prompt configured for the intent, indicating that the user intent is not understood, the x-amz-dialog-state header is set to ElicitIntent and the x-amz-slot-to-elicit header is omitted.
In addition, Amazon Lex also returns your application-specific sessionAttributes. For more information, see Managing Conversation Context.
Sends user input (text-only) to Amazon Lex. Client applications can use this API to send requests to Amazon Lex at runtime. Amazon Lex then interprets the user input using the machine learning model it built for the bot.
In response, Amazon Lex returns the next message to convey to the user an optional responseCard to display. Consider the following example messages:
For a user input \"I would like a pizza\", Amazon Lex might return a response with a message eliciting slot data (for example, PizzaSize): \"What size pizza would you like?\"
After the user provides all of the pizza order information, Amazon Lex might return a response with a message to obtain user confirmation \"Proceed with the pizza order?\".
After the user replies to a confirmation prompt with a \"yes\", Amazon Lex might return a conclusion statement: \"Thank you, your cheese pizza has been ordered.\".
Not all Amazon Lex messages require a user response. For example, a conclusion statement does not require a response. Some messages require only a \"yes\" or \"no\" user response. In addition to the message, Amazon Lex provides additional context about the message in the response that you might use to enhance client behavior, for example, to display the appropriate client user interface. These are the slotToElicit, dialogState, intentName, and slots fields in the response. Consider the following examples:
If the message is to elicit slot data, Amazon Lex returns the following context information:
dialogState set to ElicitSlot
intentName set to the intent name in the current context
slotToElicit set to the slot name for which the message is eliciting information
slots set to a map of slots, configured for the intent, with currently known values
If the message is a confirmation prompt, the dialogState is set to ConfirmIntent and SlotToElicit is set to null.
If the message is a clarification prompt (configured for the intent) that indicates that user intent is not understood, the dialogState is set to ElicitIntent and slotToElicit is set to null.
In addition, Amazon Lex also returns your application-specific sessionAttributes. For more information, see Managing Conversation Context.
One of the dependencies, such as AWS Lambda or Amazon Polly, threw an exception. For example,
If Amazon Lex does not have sufficient permissions to call a Lambda function.
If a Lambda function takes longer than 30 seconds to execute.
If a fulfillment Lambda function returns a Delegate dialog action without removing any slot values.
User input in PCM or Opus audio format or text format as described in the Content-Type HTTP header.
You can stream audio data to Amazon Lex or you can create a local buffer that captures all of the audio data before sending. In general, you get better performance if you stream audio data rather than buffering the data locally.
" } }, "required": [ "inputStream" ], "type": "object" }, "PostContentResponse": { "properties": { "audioStream": { "$ref": "#/definitions/BlobStream", "description": "The prompt (or statement) to convey to the user. This is based on the bot configuration and context. For example, if Amazon Lex did not understand the user intent, it sends theclarificationPrompt configured for the bot. If the intent requires confirmation before taking the fulfillment action, it sends the confirmationPrompt. Another example: Suppose that the Lambda function successfully fulfilled the intent, and sent a message to convey to the user. Then Amazon Lex sends that message in the response. "
}
},
"type": "object"
},
"PostTextRequest": {
"properties": {
"inputText": {
"$ref": "#/definitions/Text",
"description": "The text that the user entered (Amazon Lex interprets this text)."
},
"requestAttributes": {
"$ref": "#/definitions/StringMap",
"description": "Request-specific information passed between Amazon Lex and a client application.
The namespace x-amz-lex: is reserved for special attributes. Don't create any request attributes with the prefix x-amz-lex:.
For more information, see Setting Request Attributes.
" }, "sessionAttributes": { "$ref": "#/definitions/StringMap", "description": "Application-specific information passed between Amazon Lex and a client application.
For more information, see Setting Session Attributes.
" } }, "required": [ "inputText" ], "type": "object" }, "PostTextResponse": { "properties": { "dialogState": { "$ref": "#/definitions/DialogState", "description": " Identifies the current state of the user interaction. Amazon Lex returns one of the following values as dialogState. The client can optionally use this information to customize the user interface.
ElicitIntent - Amazon Lex wants to elicit user intent.
For example, a user might utter an intent (\"I want to order a pizza\"). If Amazon Lex cannot infer the user intent from this utterance, it will return this dialogState.
ConfirmIntent - Amazon Lex is expecting a \"yes\" or \"no\" response.
For example, Amazon Lex wants user confirmation before fulfilling an intent.
Instead of a simple \"yes\" or \"no,\" a user might respond with additional information. For example, \"yes, but make it thick crust pizza\" or \"no, I want to order a drink\". Amazon Lex can process such additional information (in these examples, update the crust type slot value, or change intent from OrderPizza to OrderDrink).
ElicitSlot - Amazon Lex is expecting a slot value for the current intent.
For example, suppose that in the response Amazon Lex sends this message: \"What size pizza would you like?\". A user might reply with the slot value (e.g., \"medium\"). The user might also provide additional information in the response (e.g., \"medium thick crust pizza\"). Amazon Lex can process such additional information appropriately.
Fulfilled - Conveys that the Lambda function configured for the intent has successfully fulfilled the intent.
ReadyForFulfillment - Conveys that the client has to fulfill the intent.
Failed - Conveys that the conversation with the user failed.
This can happen for various reasons including that the user did not provide an appropriate response to prompts from the service (you can configure how many times Amazon Lex can prompt a user for specific information), or the Lambda function failed to fulfill the intent.
Delegate as the dialogAction.type in its response, then Amazon Lex decides the next course of action and selects an appropriate message from the bot configuration based on the current user interaction context. For example, if Amazon Lex is not able to understand the user input, it uses a clarification prompt message (for more information, see the Error Handling section in the Amazon Lex console). Another example: if the intent requires confirmation before fulfillment, then Amazon Lex uses the confirmation prompt message in the intent configuration. If the code hook returns a message, Amazon Lex passes it as-is in its response to the client. "
},
"responseCard": {
"$ref": "#/definitions/ResponseCard",
"description": "Represents the options that the user has to respond to the current prompt. Response Card can come from the bot configuration (in the Amazon Lex console, choose the settings button next to a slot) or from a code hook (Lambda function). "
},
"sessionAttributes": {
"$ref": "#/definitions/StringMap",
"description": "A map of key-value pairs representing the session-specific context information."
},
"slotToElicit": {
"$ref": "#/definitions/String",
"description": "If the dialogState value is ElicitSlot, returns the name of the slot for which Amazon Lex is eliciting a value. "
},
"slots": {
"$ref": "#/definitions/StringMap",
"description": "The intent slots that Amazon Lex detected from the user input in the conversation.
Amazon Lex creates a resolution list containing likely values for a slot. The value that it returns is determined by the valueSelectionStrategy selected when the slot type was created or updated. If valueSelectionStrategy is set to ORIGINAL_VALUE, the value provided by the user is returned, if the user value is similar to the slot values. If valueSelectionStrategy is set to TOP_RESOLUTION Amazon Lex returns the first value in the resolution list or, if there is no resolution list, null. If you don't specify a valueSelectionStrategy, the default is ORIGINAL_VALUE.
dialogCodeHook and fulfillmentActivity on an intent).",
"properties": {
"contentType": {
"$ref": "#/definitions/ContentType",
"description": "The content type of the response."
},
"genericAttachments": {
"$ref": "#/definitions/genericAttachmentList",
"description": "An array of attachment objects representing options."
},
"version": {
"$ref": "#/definitions/String",
"description": "The version of the response card format."
}
},
"type": "object"
},
"String": {
"type": "string"
},
"StringMap": {
"items": {
"properties": {
"key": {
"$ref": "#/definitions/String"
},
"value": {
"$ref": "#/definitions/String"
}
},
"type": "object"
},
"type": "array"
},
"StringUrlWithLength": {
"maxLength": 2048,
"minLength": 1,
"type": "string"
},
"StringWithLength": {
"maxLength": 80,
"minLength": 1,
"type": "string"
},
"Text": {
"format": "password",
"maxLength": 1024,
"minLength": 1,
"type": "string"
},
"UnsupportedMediaTypeException": {
"description": "The Content-Type header (PostContent API) has an invalid value. ",
"properties": {
"message": {
"$ref": "#/definitions/String"
}
},
"type": "object"
},
"UserId": {
"maxLength": 100,
"minLength": 2,
"pattern": "[0-9a-zA-Z._:-]+",
"type": "string"
},
"genericAttachmentList": {
"items": {
"$ref": "#/definitions/GenericAttachment"
},
"maxItems": 10,
"minItems": 0,
"type": "array"
},
"listOfButtons": {
"items": {
"$ref": "#/definitions/Button"
},
"maxItems": 5,
"minItems": 0,
"type": "array"
}
}
}