Amazon Lex
Developer Guide

The AWS Documentation website is getting a new look!
Try it now and let us know what you think. Switch to the new look >>

You can return to the original look by selecting English in the language selector above.

GetSession

Returns session information for a specified bot, alias, and user ID.

Request Syntax

GET /bot/botName/alias/botAlias/user/userId/session HTTP/1.1

URI Request Parameters

The request requires the following URI parameters.

botAlias

The alias in use for the bot that contains the session data.

botName

The name of the bot that contains the session data.

userId

The ID of the client application user. Amazon Lex uses this to identify a user's conversation with your bot.

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

Pattern: [0-9a-zA-Z._:-]+

Request Body

The request does not have a request body.

Response Syntax

HTTP/1.1 200 Content-type: application/json { "dialogAction": { "fulfillmentState": "string", "intentName": "string", "message": "string", "messageFormat": "string", "slots": { "string" : "string" }, "slotToElicit": "string", "type": "string" }, "recentIntentSummaryView": [ { "confirmationStatus": "string", "dialogActionType": "string", "fulfillmentState": "string", "intentName": "string", "slots": { "string" : "string" }, "slotToElicit": "string" } ], "sessionAttributes": { "string" : "string" }, "sessionId": "string" }

Response Elements

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

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

dialogAction

Describes the current state of the bot.

Type: DialogAction object

recentIntentSummaryView

An array of information about the intents used in the session. The array can contain a maximum of three summaries. If more than three intents are used in the session, the recentIntentSummaryView operation contains information about the last three intents used.

Type: Array of IntentSummary objects

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

sessionAttributes

Map of key/value pairs representing the session-specific context information. It contains application information passed between Amazon Lex and a client application.

Type: String to string map

sessionId

A unique identifier for the session.

Type: String

Errors

BadRequestException

Request validation failed, there is no usable message in the context, or the bot build failed, is still in progress, or contains unbuilt changes.

HTTP Status Code: 400

InternalFailureException

Internal service error. Retry the call.

HTTP Status Code: 500

LimitExceededException

Exceeded a limit.

HTTP Status Code: 429

NotFoundException

The resource (such as the Amazon Lex bot or an alias) that is referred to is not found.

HTTP Status Code: 404

See Also

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