你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn

Chat - List Chat Threads

Gets the list of chat threads of a user.

GET {endpoint}/chat/threads?api-version=2024-03-07
GET {endpoint}/chat/threads?maxPageSize={maxPageSize}&startTime={startTime}&api-version=2024-03-07

URI Parameters

Name In Required Type Description
endpoint
path True

string

The endpoint of the Azure Communication resource.

api-version
query True

string

Version of API to invoke.

maxPageSize
query

integer

int32

The maximum number of chat threads returned per page.

startTime
query

string

date-time

The earliest point in time to get chat threads up to. The timestamp should be in RFC3339 format: yyyy-MM-ddTHH:mm:ssZ.

Request Header

Name Required Type Description
Authorization True

string

An ACS (Azure Communication Services) user access token.

Responses

Name Type Description
200 OK

ChatThreadsItemCollection

Request successful. The action returns a GetThreadsResponse resource.

401 Unauthorized

CommunicationErrorResponse

Unauthorized.

403 Forbidden

CommunicationErrorResponse

Forbidden.

429 Too Many Requests

CommunicationErrorResponse

Too many requests.

Other Status Codes

CommunicationErrorResponse

Service unavailable.

Security

Authorization

An ACS (Azure Communication Services) user access token.

Type: apiKey
In: header

Examples

Get threads with pagination (Max Page Size)

Sample Request

GET https://contoso.westus.communications.azure.com/chat/threads?maxPageSize=5&api-version=2024-03-07

Sample Response

{
  "value": [
    {
      "id": "19:uni01_zbnh3nt2dfuffezc3sox7dog7wfhk6y5qe2rwlnfhlhdzirihdpq@thread.v2",
      "topic": "Chat with Samantha",
      "lastMessageReceivedOn": "2020-06-06T05:55:41.6460000Z"
    },
    {
      "id": "19:a0dfe5fc10e04a7f8d8a64d455f4196d@thread.v2",
      "topic": "Presentation Brainstorming",
      "lastMessageReceivedOn": "2020-06-06T05:55:41.6460000Z"
    },
    {
      "id": "19:uni01_n242d2bzammtwxiib7pbjtozeevjqzavzn654ku3dajocexfo2na@thread.v2",
      "topic": "Chat with Alex",
      "lastMessageReceivedOn": "2020-06-06T05:55:41.6460000Z"
    },
    {
      "id": "19:0062022a28be4e0983734f7e45cd8566@thread.v2",
      "topic": "Lunch",
      "deletedOn": "2020-07-07T05:55:41.6460000Z",
      "lastMessageReceivedOn": "2020-06-06T05:55:41.6460000Z"
    },
    {
      "id": "19:uni01_zbnh3nt2dfuffezc3sox7dog7wfhk6y5qe2rwlnfhlhdzirihdpe@thread.v2",
      "topic": "Chat with Bob",
      "lastMessageReceivedOn": "2020-06-06T05:55:41.6460000Z"
    }
  ],
  "nextLink": "https://contoso.westus.communications.azure.com/chat/threads?syncState=W3sic3RhcnQiOiIyMDIwLTA2LTIzVDIzOjMyOjQ3LjMwNSswMDowMCIsImVuZCI6IjIwMjAtMDYtMjVUMDY6NTY6MjMuNjk2KzAwOjAwIn0seyJzdGFydCI6IjE5NzAtMDEtMDFUMDA6MDA6MDArMDA6MDAiLCJlbmQiOiIxOTcwLTAxLTAxVDAwOjAwOjAwKzAwOjAwIn1d&api-version=2024-03-07&maxPageSize=5"
}
{
  "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."
  }
}

Definitions

Name Description
ChatThreadItem

Summary information of a chat thread.

ChatThreadsItemCollection

Collection of chat threads.

ChatThreadItem

Summary information of a chat thread.

Name Type Description
deletedOn

string

The timestamp when the chat thread was deleted. The timestamp is in RFC3339 format: yyyy-MM-ddTHH:mm:ssZ.

id

string

Chat thread id.

lastMessageReceivedOn

string

The timestamp when the last message arrived at the server. The timestamp is in RFC3339 format: yyyy-MM-ddTHH:mm:ssZ.

topic

string

Chat thread topic.

ChatThreadsItemCollection

Collection of chat threads.

Name Type Description
nextLink

string

If there are more chat threads that can be retrieved, the next link will be populated.

value

ChatThreadItem[]

Collection of chat threads.