

支援終止通知：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)。

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

# GetUtterancesView
<a name="API_GetUtterancesView"></a>

使用 `GetUtterancesView`操作來取得有關使用者對機器人表達之表達用語的資訊。您可以使用此清單來調校機器人回應的表達用語。

例如，假設您已建立機器人來訂購花。您的使用者使用機器人一段時間後，請使用 `GetUtterancesView`操作來查看他們提出的請求，以及他們是否成功。您可能會發現無法辨識表達用語「我想要花朵」。您可以將此表達用語新增至`OrderFlowers`意圖，讓您的機器人辨識該表達用語。

發佈新版本的機器人之後，您可以取得舊版本和新版本的相關資訊，以便比較兩個版本的效能。

表達用語統計資料為每天產生一次。資料在過去 15 天內可供使用。您可以在每個請求中請求最多 5 個版本的機器人資訊。Amazon Lex 會傳回機器人在過去 15 天內最常收到的表達用語。回應包含每個版本最多 100 個表達用語的相關資訊。

在下列情況下，不會產生張量統計資料：
+ 建立機器人時， `childDirected` 欄位設定為 true。
+ 您正在將插槽混淆與一或多個插槽搭配使用。
+ 您選擇不參與改善 Amazon Lex。

這項操作需要 `lex:GetUtterancesView` 動作的許可。

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

```
GET /bots/botname/utterances?view=aggregation&bot_versions=botVersions&status_type=statusType HTTP/1.1
```

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

請求會使用下列 URI 參數。

 ** [botname](#API_GetUtterancesView_RequestSyntax) **   <a name="lex-GetUtterancesView-request-uri-botName"></a>
應傳回表達用語資訊的機器人名稱。  
長度限制：長度下限為 2。長度上限為 50。  
模式：`^([A-Za-z]_?)+$`  
必要：是

 ** [botVersions](#API_GetUtterancesView_RequestSyntax) **   <a name="lex-GetUtterancesView-request-uri-botVersions"></a>
應傳回表達用語資訊的機器人版本陣列。限制為每個請求 5 個版本。  
陣列成員：項目數下限為 1。項目數上限為 5。  
長度限制：長度下限為 1。長度上限為 64。  
模式：`\$LATEST|[0-9]+`  
必要：是

 ** [statusType](#API_GetUtterancesView_RequestSyntax) **   <a name="lex-GetUtterancesView-request-uri-statusType"></a>
若要傳回辨識和處理的表達用語，請使用 `Detected`。若要傳回無法辨識的表達用語，請使用 `Missed`。  
有效值:`Detected | Missed`   
必要：是

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

請求沒有請求主體。

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

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

{
   "botName": "string",
   "utterances": [ 
      { 
         "botVersion": "string",
         "utterances": [ 
            { 
               "count": number,
               "distinctUsers": number,
               "firstUtteredDate": number,
               "lastUtteredDate": number,
               "utteranceString": "string"
            }
         ]
      }
   ]
}
```

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

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

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

 ** [botName](#API_GetUtterancesView_ResponseSyntax) **   <a name="lex-GetUtterancesView-response-botName"></a>
傳回表達用語資訊的機器人名稱。  
類型：字串  
長度限制：長度下限為 2。長度上限為 50。  
模式：`^([A-Za-z]_?)+$`

 ** [utterances](#API_GetUtterancesView_ResponseSyntax) **   <a name="lex-GetUtterancesView-response-utterances"></a>
物件陣列，每個[UtteranceList](API_UtteranceList.md)物件都包含描述機器人處理之表達用語的[UtteranceData](API_UtteranceData.md)物件清單。每個版本的回應最多包含 100 個`UtteranceData`物件。Amazon Lex 會傳回機器人在過去 15 天內最常收到的表達用語。  
類型：[UtteranceList](API_UtteranceList.md) 物件陣列

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

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

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

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

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

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