

サポート終了通知: 2025 年 9 月 15 日、 AWS は Amazon Lex V1 のサポートを終了します。 V1 2025 年 9 月 15 日を過ぎると、Amazon Lex V1 コンソールまたは Amazon Lex V1 リソースにはアクセスできなくなります。Amazon Lex V2 を使用している場合は、代わりに [Amazon Lex V2 ガイド](https://docs.aws.amazon.com/lexv2/latest/dg/what-is.html)を参照してください。

翻訳は機械翻訳により提供されています。提供された翻訳内容と英語版の間で齟齬、不一致または矛盾がある場合、英語版が優先します。

# GetSession
<a name="API_runtime_GetSession"></a>

指定されたボット、エイリアス、ユーザー ID のセッション情報を返します。

## リクエストの構文
<a name="API_runtime_GetSession_RequestSyntax"></a>

```
GET /bot/botName/alias/botAlias/user/userId/session/?checkpointLabelFilter=checkpointLabelFilter HTTP/1.1
```

## URI リクエストパラメータ
<a name="API_runtime_GetSession_RequestParameters"></a>

リクエストでは、次の URI パラメータを使用します。

 ** [botAlias](#API_runtime_GetSession_RequestSyntax) **   <a name="lex-runtime_GetSession-request-uri-botAlias"></a>
セッションデータを含むボットに使用されるエイリアス。  
必須: はい

 ** [botName](#API_runtime_GetSession_RequestSyntax) **   <a name="lex-runtime_GetSession-request-uri-botName"></a>
セッションデータを含むボットの名前。  
必須: はい

 ** [checkpointLabelFilter](#API_runtime_GetSession_RequestSyntax) **   <a name="lex-runtime_GetSession-request-uri-checkpointLabelFilter"></a>
`recentIntentSummaryView` 構造体で返されるインテントをフィルタリングするための文字列。  
フィルターを指定すると、`checkpointLabel` フィールドにその文字列が設定されているインテントのみが返されます。  
長さの制限：最小長 1、最大長は 255 です。  
パターン: `[a-zA-Z0-9-]+` 

 ** [userId](#API_runtime_GetSession_RequestSyntax) **   <a name="lex-runtime_GetSession-request-uri-userId"></a>
クライアントアプリケーションユーザーの ID。Amazon Lex は、ユーザーとボットとの会話を識別するために使用します。  
長さの制限: 最小長は 2 です。最大長は 100 です。  
パターン: `[0-9a-zA-Z._:-]+`   
必須: はい

## リクエストボディ
<a name="API_runtime_GetSession_RequestBody"></a>

リクエストにリクエスト本文がありません。

## レスポンスの構文
<a name="API_runtime_GetSession_ResponseSyntax"></a>

```
HTTP/1.1 200
Content-type: application/json

{
   "activeContexts": [ 
      { 
         "name": "string",
         "parameters": { 
            "string" : "string" 
         },
         "timeToLive": { 
            "timeToLiveInSeconds": number,
            "turnsToLive": number
         }
      }
   ],
   "dialogAction": { 
      "fulfillmentState": "string",
      "intentName": "string",
      "message": "string",
      "messageFormat": "string",
      "slots": { 
         "string" : "string" 
      },
      "slotToElicit": "string",
      "type": "string"
   },
   "recentIntentSummaryView": [ 
      { 
         "checkpointLabel": "string",
         "confirmationStatus": "string",
         "dialogActionType": "string",
         "fulfillmentState": "string",
         "intentName": "string",
         "slots": { 
            "string" : "string" 
         },
         "slotToElicit": "string"
      }
   ],
   "sessionAttributes": { 
      "string" : "string" 
   },
   "sessionId": "string"
}
```

## レスポンス要素
<a name="API_runtime_GetSession_ResponseElements"></a>

アクションが成功すると、サービスは HTTP 200 レスポンスを返します。

サービスから以下のデータが JSON 形式で返されます。

 ** [activeContexts](#API_runtime_GetSession_ResponseSyntax) **   <a name="lex-runtime_GetSession-response-activeContexts"></a>
セッションのアクティブコンテキストのリスト。コンテキストは、インテントが達成されたとき、または `PostContent`、`PostText`、`PutSession` のオペレーションを呼び出したときに設定できます。  
コンテキストを使用して、あるインテントをフォローできるインテントを制御したり、アプリケーションの動作を変更したりすることができます。  
型: [ActiveContext](API_runtime_ActiveContext.md) オブジェクトの配列  
配列メンバー: 最小数は 0 項目です。最大数は 20 項目です。

 ** [dialogAction](#API_runtime_GetSession_ResponseSyntax) **   <a name="lex-runtime_GetSession-response-dialogAction"></a>
ボットの現在の状態を示します。  
型: [DialogAction](API_runtime_DialogAction.md) オブジェクト

 ** [recentIntentSummaryView](#API_runtime_GetSession_ResponseSyntax) **   <a name="lex-runtime_GetSession-response-recentIntentSummaryView"></a>
セッションで使用されるインテントに関する情報の配列。配列には最大 3 つのサマリーを含めることができます。セッションで 3 つ以上のインテントが使用されている場合、`recentIntentSummaryView` オペレーションには最後に使用された 3 つのインテントに関する情報が含まれています。  
リクエストに `checkpointLabelFilter` パラメータを設定した場合、配列には、指定されたラベルを持つインテントのみが含まれます。  
型: [IntentSummary](API_runtime_IntentSummary.md) オブジェクトの配列  
配列メンバー: 最小数は 0 項目です。最大数は 3 項目です。

 ** [sessionAttributes](#API_runtime_GetSession_ResponseSyntax) **   <a name="lex-runtime_GetSession-response-sessionAttributes"></a>
セッション固有のコンテキスト情報を表すキーバリューのペアのマップ。Amazon Lex とクライアントアプリケーションの間で渡されるアプリケーション情報を含みます。  
型: 文字列間のマッピング

 ** [sessionId](#API_runtime_GetSession_ResponseSyntax) **   <a name="lex-runtime_GetSession-response-sessionId"></a>
セッションの一意の識別子。  
タイプ: 文字列

## エラー
<a name="API_runtime_GetSession_Errors"></a>

 ** BadRequestException **   
 リクエストの検証に失敗したか、コンテキストに使用可能なメッセージがないか、ボットの構築が失敗もしくは進行中であるか、または構築されていない変更が含まれています。  
HTTP ステータスコード: 400

 ** InternalFailureException **   
内部サービスエラー。呼び出しを再試行します。  
HTTP ステータスコード: 500

 ** LimitExceededException **   
制限を超えました。  
HTTP ステータスコード: 429

 ** NotFoundException **   
参照するリソース (Amazon Lex bot やエイリアスなど) が見つかりません。  
HTTP ステータスコード: 404

## 以下の資料も参照してください。
<a name="API_runtime_GetSession_SeeAlso"></a>

言語固有の AWS SDKs のいずれかでこの API を使用する方法の詳細については、以下を参照してください。
+  [AWS コマンドラインインターフェイス V2](https://docs.aws.amazon.com/goto/cli2/runtime.lex-2016-11-28/GetSession) 
+  [AWS SDK for .NET V4](https://docs.aws.amazon.com/goto/DotNetSDKV4/runtime.lex-2016-11-28/GetSession) 
+  [AWS SDK for C\$1\$1](https://docs.aws.amazon.com/goto/SdkForCpp/runtime.lex-2016-11-28/GetSession) 
+  [AWS SDK for Go v2](https://docs.aws.amazon.com/goto/SdkForGoV2/runtime.lex-2016-11-28/GetSession) 
+  [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/runtime.lex-2016-11-28/GetSession) 
+  [AWS SDK for JavaScript V3](https://docs.aws.amazon.com/goto/SdkForJavaScriptV3/runtime.lex-2016-11-28/GetSession) 
+  [AWS SDK for Kotlin](https://docs.aws.amazon.com/goto/SdkForKotlin/runtime.lex-2016-11-28/GetSession) 
+  [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/runtime.lex-2016-11-28/GetSession) 
+  [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/runtime.lex-2016-11-28/GetSession) 
+  [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/runtime.lex-2016-11-28/GetSession) 