# 获取对话结果

本接口用于获取智能体的对话回复，内容包括文字和产物等信息。

## 请求

基本 | &nbsp;
---|---
HTTP URL | https://open.feishu.cn/open-apis/aily/v1/agents/:agent_id/chats/:agent_chat_id
HTTP Method | GET
接口频率限制 | [特殊频控](https://open.feishu.cn/document/ukTMukTMukTM/uUzN04SN3QjL1cDN)
支持的应用类型 | Custom App
权限要求<br>**调用该 API 所需的权限。开启其中任意一项权限即可调用** | 获取团队智能体的对话内容(aily:agent_chat:read)

### 请求头

名称 | 类型 | 必填 | 描述
---|---|---|---
Authorization | string | 是 | `tenant_access_token`<br>或<br>`user_access_token`<br>**值格式**："Bearer `access_token`"<br>**示例值**："Bearer u-7f1bcd13fc57d46bac21793a18e560"<br>[了解更多：如何选择与获取 access token](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-choose-which-type-of-token-to-use)

### 路径参数

名称 | 类型 | 描述
---|---|---
agent_id | string | 智能体id，通过智能体后台详情的地址栏中获取<br>**示例值**："agent_4k4ue29hpwrx2"<br>**数据校验规则**：<br>- 长度范围：`0` ～ `65` 字符
agent_chat_id | string | 智能体对话ID，通过[发起对话](https://open.larkoffice.com/document/uAjLw4CM/ukTMukTMukTM/aily-v1/agent-agent_chat/create)接口获取<br>**示例值**："7640186506971926032"<br>**数据校验规则**：<br>- 长度范围：`0` ～ `64` 字符

## 响应

### 响应体

名称 | 类型 | 描述
---|---|---
code | int | 错误码，非 0 表示失败
msg | string | 错误描述
data | \- | \-
content | agent_chat_message\[\] | Agent回复内容
type | string | 类型
text | string | 文本内容
agent_artifact_id | string | 产物id
artifact_type | string | 产物类型
finish_reason | string | 对话结束原因
status | string | 状态

### 响应体示例
```json
{
    "code": 0,
    "msg": "success",
    "data": {
        "content": [
            {
                "type": "text",
                "text": "你好，我是你的专属智能体，请问有什么可以帮你？",
                "agent_artifact_id": "3d058789-6952-4697-bf9c-1add1ebc206e",
                "artifact_type": "sandbox_file"
            }
        ],
        "finish_reason": "stop",
        "status": "Cancelled"
    }
}
```

### 错误码

HTTP状态码 | 错误码 | 描述 | 排查建议
---|---|---|---
400 | 2700001 | param is invalid | 检查参数是否正确

