

支援終止通知：2025 年 9 月 15 日， AWS 將停止對 Amazon Lex 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)。

本文為英文版的機器翻譯版本，如內容有任何歧義或不一致之處，概以英文版為準。

# GetIntent
<a name="API_GetIntent"></a>

 傳回意圖的相關資訊。除了意圖名稱之外，您還必須指定意圖版本。

 這項操作需要許可來執行 `lex:GetIntent` 動作。

## 請求語法
<a name="API_GetIntent_RequestSyntax"></a>

```
GET /intents/name/versions/version HTTP/1.1
```

## URI 請求參數
<a name="API_GetIntent_RequestParameters"></a>

請求會使用下列 URI 參數。

 ** [name](#API_GetIntent_RequestSyntax) **   <a name="lex-GetIntent-request-uri-name"></a>
意圖的名稱。名稱區分大小寫。  
長度限制：長度下限為 1。長度上限為 100。  
模式：`^([A-Za-z]_?)+$`  
必要：是

 ** [version](#API_GetIntent_RequestSyntax) **   <a name="lex-GetIntent-request-uri-version"></a>
意圖的版本。  
長度限制：長度下限為 1。長度上限為 64。  
模式：`\$LATEST|[0-9]+`  
必要：是

## 請求主體
<a name="API_GetIntent_RequestBody"></a>

請求沒有請求主體。

## 回應語法
<a name="API_GetIntent_ResponseSyntax"></a>

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

{
   "checksum": "string",
   "conclusionStatement": { 
      "messages": [ 
         { 
            "content": "string",
            "contentType": "string",
            "groupNumber": number
         }
      ],
      "responseCard": "string"
   },
   "confirmationPrompt": { 
      "maxAttempts": number,
      "messages": [ 
         { 
            "content": "string",
            "contentType": "string",
            "groupNumber": number
         }
      ],
      "responseCard": "string"
   },
   "createdDate": number,
   "description": "string",
   "dialogCodeHook": { 
      "messageVersion": "string",
      "uri": "string"
   },
   "followUpPrompt": { 
      "prompt": { 
         "maxAttempts": number,
         "messages": [ 
            { 
               "content": "string",
               "contentType": "string",
               "groupNumber": number
            }
         ],
         "responseCard": "string"
      },
      "rejectionStatement": { 
         "messages": [ 
            { 
               "content": "string",
               "contentType": "string",
               "groupNumber": number
            }
         ],
         "responseCard": "string"
      }
   },
   "fulfillmentActivity": { 
      "codeHook": { 
         "messageVersion": "string",
         "uri": "string"
      },
      "type": "string"
   },
   "inputContexts": [ 
      { 
         "name": "string"
      }
   ],
   "kendraConfiguration": { 
      "kendraIndex": "string",
      "queryFilterString": "string",
      "role": "string"
   },
   "lastUpdatedDate": number,
   "name": "string",
   "outputContexts": [ 
      { 
         "name": "string",
         "timeToLiveInSeconds": number,
         "turnsToLive": number
      }
   ],
   "parentIntentSignature": "string",
   "rejectionStatement": { 
      "messages": [ 
         { 
            "content": "string",
            "contentType": "string",
            "groupNumber": number
         }
      ],
      "responseCard": "string"
   },
   "sampleUtterances": [ "string" ],
   "slots": [ 
      { 
         "defaultValueSpec": { 
            "defaultValueList": [ 
               { 
                  "defaultValue": "string"
               }
            ]
         },
         "description": "string",
         "name": "string",
         "obfuscationSetting": "string",
         "priority": number,
         "responseCard": "string",
         "sampleUtterances": [ "string" ],
         "slotConstraint": "string",
         "slotType": "string",
         "slotTypeVersion": "string",
         "valueElicitationPrompt": { 
            "maxAttempts": number,
            "messages": [ 
               { 
                  "content": "string",
                  "contentType": "string",
                  "groupNumber": number
               }
            ],
            "responseCard": "string"
         }
      }
   ],
   "version": "string"
}
```

## 回應元素
<a name="API_GetIntent_ResponseElements"></a>

如果動作成功，則服務傳回 HTTP 200 回應。

服務會傳回下列 JSON 格式的資料。

 ** [checksum](#API_GetIntent_ResponseSyntax) **   <a name="lex-GetIntent-response-checksum"></a>
意圖的檢查總和。  
類型：字串

 ** [conclusionStatement](#API_GetIntent_ResponseSyntax) **   <a name="lex-GetIntent-response-conclusionStatement"></a>
在 `fulfillmentActivity`元素中指定的 Lambda 函數滿足意圖後，Amazon Lex 會將此陳述式傳達給使用者。  
類型：[Statement](API_Statement.md) 物件

 ** [confirmationPrompt](#API_GetIntent_ResponseSyntax) **   <a name="lex-GetIntent-response-confirmationPrompt"></a>
如果在機器人中定義，Amazon Lex 會使用提示來確認意圖，然後再滿足使用者的請求。如需詳細資訊，請參閱[PutIntent](API_PutIntent.md)。  
類型：[Prompt](API_Prompt.md) 物件

 ** [createdDate](#API_GetIntent_ResponseSyntax) **   <a name="lex-GetIntent-response-createdDate"></a>
建立意圖的日期。  
類型：Timestamp

 ** [description](#API_GetIntent_ResponseSyntax) **   <a name="lex-GetIntent-response-description"></a>
意圖的描述。  
類型：字串  
長度限制：長度下限為 0。長度上限為 200。

 ** [dialogCodeHook](#API_GetIntent_ResponseSyntax) **   <a name="lex-GetIntent-response-dialogCodeHook"></a>
如果在機器人中定義，Amazon Amazon Lex 會為每個使用者輸入調用此 Lambda 函數。如需詳細資訊，請參閱[PutIntent](API_PutIntent.md)。  
類型：[CodeHook](API_CodeHook.md) 物件

 ** [followUpPrompt](#API_GetIntent_ResponseSyntax) **   <a name="lex-GetIntent-response-followUpPrompt"></a>
如果在機器人中定義，Amazon Lex 會使用此提示在意圖實現之後請求額外的使用者活動。如需詳細資訊，請參閱[PutIntent](API_PutIntent.md)。  
類型：[FollowUpPrompt](API_FollowUpPrompt.md) 物件

 ** [fulfillmentActivity](#API_GetIntent_ResponseSyntax) **   <a name="lex-GetIntent-response-fulfillmentActivity"></a>
描述如何實現意圖。如需詳細資訊，請參閱[PutIntent](API_PutIntent.md)。  
類型：[FulfillmentActivity](API_FulfillmentActivity.md) 物件

 ** [inputContexts](#API_GetIntent_ResponseSyntax) **   <a name="lex-GetIntent-response-inputContexts"></a>
物件陣列`InputContext`，列出 Amazon Lex 在與使用者的對話中必須處於作用中狀態的內容，以選擇意圖。  
類型：[InputContext](API_InputContext.md) 物件陣列  
陣列成員：項目數下限為 0。項目數上限為 5。

 ** [kendraConfiguration](#API_GetIntent_ResponseSyntax) **   <a name="lex-GetIntent-response-kendraConfiguration"></a>
若有組態資訊，請使用 `AMAZON.KendraSearchIntent`意圖連線至 Amazon Kendra 索引。  
類型：[KendraConfiguration](API_KendraConfiguration.md) 物件

 ** [lastUpdatedDate](#API_GetIntent_ResponseSyntax) **   <a name="lex-GetIntent-response-lastUpdatedDate"></a>
意圖更新的日期。當您建立資源時，建立日期和上次更新的日期相同。  
類型：Timestamp

 ** [name](#API_GetIntent_ResponseSyntax) **   <a name="lex-GetIntent-response-name"></a>
意圖的名稱。  
類型：字串  
長度限制：長度下限為 1。長度上限為 100。  
模式：`^([A-Za-z]_?)+$`

 ** [outputContexts](#API_GetIntent_ResponseSyntax) **   <a name="lex-GetIntent-response-outputContexts"></a>
物件陣列`OutputContext`，列出意圖在滿足意圖時啟用的內容。  
類型：[OutputContext](API_OutputContext.md) 物件陣列  
陣列成員：項目數下限為 0。項目數上限為 10。

 ** [parentIntentSignature](#API_GetIntent_ResponseSyntax) **   <a name="lex-GetIntent-response-parentIntentSignature"></a>
內建意圖的唯一識別符。  
類型：字串

 ** [rejectionStatement](#API_GetIntent_ResponseSyntax) **   <a name="lex-GetIntent-response-rejectionStatement"></a>
如果使用者對 中定義的問題回答「否」`confirmationPrompt`，Amazon Lex 會回應此陳述式，以確認意圖已取消。  
類型：[Statement](API_Statement.md) 物件

 ** [sampleUtterances](#API_GetIntent_ResponseSyntax) **   <a name="lex-GetIntent-response-sampleUtterances"></a>
為意圖設定的範例表達用語陣列。  
類型：字串陣列  
陣列成員：項目數下限為 0。最多 1500 個項目。  
長度限制：長度下限為 1。長度上限為 200。

 ** [slots](#API_GetIntent_ResponseSyntax) **   <a name="lex-GetIntent-response-slots"></a>
為意圖設定的意圖插槽陣列。  
類型：[Slot](API_Slot.md) 物件陣列  
陣列成員：項目數下限為 0。項目數上限為 100。

 ** [version](#API_GetIntent_ResponseSyntax) **   <a name="lex-GetIntent-response-version"></a>
意圖的版本。  
類型：字串  
長度限制：長度下限為 1。長度上限為 64。  
模式：`\$LATEST|[0-9]+`

## 錯誤
<a name="API_GetIntent_Errors"></a>

 ** BadRequestException **   
請求格式不正確。例如，值無效或缺少必要欄位。請檢查欄位值，然後再試一次。  
HTTP 狀態碼：400

 ** InternalFailureException **   
發生內部 Amazon Lex 錯誤。請再次嘗試您的請求。  
HTTP 狀態碼：500

 ** LimitExceededException **   
請求超過限制。請再次嘗試您的請求。  
HTTP 狀態碼：429

 ** NotFoundException **   
找不到請求中指定的資源。請檢查資源，然後再試一次。  
HTTP 狀態碼：404

## 另請參閱
<a name="API_GetIntent_SeeAlso"></a>

如需在其中一種語言特定 AWS SDKs中使用此 API 的詳細資訊，請參閱下列內容：
+  [AWS 命令列界面 V2](https://docs.aws.amazon.com/goto/cli2/lex-models-2017-04-19/GetIntent) 
+  [AWS 適用於 .NET V4 的 SDK](https://docs.aws.amazon.com/goto/DotNetSDKV4/lex-models-2017-04-19/GetIntent) 
+  [AWS 適用於 C\$1\$1 的 SDK](https://docs.aws.amazon.com/goto/SdkForCpp/lex-models-2017-04-19/GetIntent) 
+  [AWS 適用於 Go 的 SDK v2](https://docs.aws.amazon.com/goto/SdkForGoV2/lex-models-2017-04-19/GetIntent) 
+  [AWS 適用於 Java V2 的 SDK](https://docs.aws.amazon.com/goto/SdkForJavaV2/lex-models-2017-04-19/GetIntent) 
+  [AWS 適用於 JavaScript V3 的 SDK](https://docs.aws.amazon.com/goto/SdkForJavaScriptV3/lex-models-2017-04-19/GetIntent) 
+  [AWS 適用於 Kotlin 的 SDK](https://docs.aws.amazon.com/goto/SdkForKotlin/lex-models-2017-04-19/GetIntent) 
+  [AWS 適用於 PHP V3 的 SDK](https://docs.aws.amazon.com/goto/SdkForPHPV3/lex-models-2017-04-19/GetIntent) 
+  [AWS 適用於 Python 的 SDK](https://docs.aws.amazon.com/goto/boto3/lex-models-2017-04-19/GetIntent) 
+  [AWS 適用於 Ruby V3 的 SDK](https://docs.aws.amazon.com/goto/SdkForRubyV3/lex-models-2017-04-19/GetIntent) 