Chat Thread - Get Chat Thread Properties
获取聊天线程的属性。
GET {endpoint}/chat/threads/{chatThreadId}?api-version=2025-03-15
URI 参数
名称 | 在 | 必需 | 类型 | 说明 |
---|---|---|---|---|
chat
|
path | True |
string |
线程的 ID。 |
endpoint
|
path | True |
string |
Azure 通信资源的终结点。 |
api-version
|
query | True |
string |
要调用的 API 版本。 |
请求头
名称 | 必需 | 类型 | 说明 |
---|---|---|---|
Authorization | True |
string |
ACS(Azure 通信服务)用户访问令牌。 |
响应
名称 | 类型 | 说明 |
---|---|---|
200 OK |
请求成功。 该操作返回聊天线程。 |
|
401 Unauthorized |
Communication |
未授权。 |
403 Forbidden |
Communication |
已禁止。 |
429 Too Many Requests |
Communication |
请求过多。 |
Other Status Codes |
Communication |
服务不可用。 |
安全性
Authorization
ACS(Azure 通信服务)用户访问令牌。
类型:
apiKey
在:
header
示例
Get chat thread
示例请求
GET https://contoso.westus.communications.azure.com/chat/threads/19:uni01_zbnh3nt2dfuffezc3sox7dog7wfhk6y5qe2rwlnfhlhdzirihdpq@thread.v2?api-version=2025-03-15
示例响应
{
"id": "19:uni01_zbnh3nt2dfuffezc3sox7dog7wfhk6y5qe2rwlnfhlhdzirihdpq@thread.v2",
"topic": "Lunch",
"createdOn": "2020-06-06T05:55:41.6460000Z",
"createdByCommunicationIdentifier": {
"rawId": "8:acs:8540c0de-899f-5cce-acb5-3ec493af3800_0e59221d-0c1d-46ae-9544-c963ce56c10b",
"communicationUser": {
"id": "8:acs:8540c0de-899f-5cce-acb5-3ec493af3800_0e59221d-0c1d-46ae-9544-c963ce56c10b"
}
}
}
{
"error": {
"code": "Unauthorized",
"message": "Request is not authorized."
}
}
{
"error": {
"code": "Forbidden",
"message": "User is not allowed to perform specified action."
}
}
{
"error": {
"code": "TooManyRequests",
"message": "Rate limit exceeded."
}
}
{
"error": {
"code": "ServiceUnavailable",
"message": "The server is currently unable to handle the request."
}
}
定义
名称 | 说明 |
---|---|
Chat |
聊天线程。 |
None |
无线程保留策略。 |
Thread |
基于线程创建日期的线程保留策略。 |
ChatThreadProperties
聊天线程。
名称 | 类型 | 说明 |
---|---|---|
createdByCommunicationIdentifier |
Communication |
|
createdOn |
string (date-time) |
创建聊天线程时的时间戳。 时间戳采用RFC3339格式: |
deletedOn |
string (date-time) |
删除聊天线程时的时间戳。 时间戳采用RFC3339格式: |
id |
string |
聊天线程 ID。 |
metadata |
object |
线程的上下文元数据。 元数据由名称/值对组成。 所有元数据对的总大小最多可为 1KB。 |
retentionPolicy | ChatRetentionPolicy: |
用于自动删除的数据保留策略。 |
topic |
string |
聊天线程主题。 |
NoneRetentionPolicy
无线程保留策略。
名称 | 类型 | 说明 |
---|---|---|
kind |
string:
none |
保留策略类型 |
ThreadCreationDateRetentionPolicy
基于线程创建日期的线程保留策略。
名称 | 类型 | 说明 |
---|---|---|
deleteThreadAfterDays |
integer (int32) |
指示线程创建后将删除线程的天数。 |
kind |
string:
thread |
保留策略类型 |