

终止支持通知：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>
意图的创建日期。  
类型：时间戳

 ** [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 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 Kendra 索引与 `AMAZON.KendraSearchIntent` 意图关联的配置信息（如果有）。  
类型：[KendraConfiguration](API_KendraConfiguration.md) 对象

 ** [lastUpdatedDate](#API_GetIntent_ResponseSyntax) **   <a name="lex-GetIntent-response-lastUpdatedDate"></a>
意图的更新日期。创建资源时，创建日期和上次更新日期相同。  
类型：时间戳

 ** [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>

有关以特定语言之一使用此 API 的更多信息 AWS SDKs，请参阅以下内容：
+  [AWS 命令行界面 V2](https://docs.aws.amazon.com/goto/cli2/lex-models-2017-04-19/GetIntent) 
+  [AWS 适用于.NET 的 SDK V4](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 v2 的 SDK](https://docs.aws.amazon.com/goto/SdkForGoV2/lex-models-2017-04-19/GetIntent) 
+  [AWS 适用于 Java 的 SDK V2](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 的 SDK V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lex-models-2017-04-19/GetIntent) 
+  [AWS Python 软件开发工具包](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) 