다음을 통해 공유


Chat Thread - List Chat Messages

스레드에서 메시지 목록을 가져옵니다.

GET {endpoint}/chat/threads/{chatThreadId}/messages?api-version=2024-03-15-preview
GET {endpoint}/chat/threads/{chatThreadId}/messages?maxPageSize={maxPageSize}&startTime={startTime}&api-version=2024-03-15-preview

URI 매개 변수

Name In(다음 안에) 필수 형식 Description
chatThreadId
path True

string

메시지의 스레드 ID입니다.

endpoint
path True

string

Azure Communication 리소스의 엔드포인트입니다.

api-version
query True

string

호출할 API의 버전입니다.

maxPageSize
query

integer

int32

페이지당 반환할 최대 메시지 수입니다.

startTime
query

string

date-time

메시지를 가져올 가장 빠른 시점입니다. 타임스탬프는 RFC3339 형식 yyyy-MM-ddTHH:mm:ssZ이어야 합니다.

요청 헤더

Name 필수 형식 Description
Authorization True

string

ACS(Azure Communication Services) 사용자 액세스 토큰입니다.

응답

Name 형식 Description
200 OK

ChatMessagesCollection

Success

401 Unauthorized

CommunicationErrorResponse

권한이 없습니다.

403 Forbidden

CommunicationErrorResponse

사용할 수 없습니다.

429 Too Many Requests

CommunicationErrorResponse

요청이 너무 많습니다.

Other Status Codes

CommunicationErrorResponse

서비스를 사용할 수 없습니다.

보안

Authorization

ACS(Azure Communication Services) 사용자 액세스 토큰입니다.

Type: apiKey
In: header

예제

Get messages with pagination (max page size)

Sample Request

GET https://contoso.westus.communications.azure.com/chat/threads/19:meeting_453dafb77b26481ea2e73bcada0324af@thread.v2/messages?maxPageSize=5&api-version=2024-03-15-preview

Sample Response

{
  "value": [
    {
      "id": "1593107077690",
      "type": "html",
      "version": "1593107077683",
      "sequenceId": "5",
      "content": {
        "message": "<p>This place for lunch?&nbsp;</p>\r\n<p><img itemscope=\"png\" src=\"\" width=\"1425\" height=\"539\" alt=\"image\" id=\"0-canaryeus-d1-907ca0083e8f3bef6793e5a46c0ded73\"></p>",
        "attachments": [
          {
            "id": "0-canaryeus-d1-907ca0083e8f3bef6793e5a46c0ded73",
            "attachmentType": "image",
            "name": "image",
            "url": "https://contoso.westus.communications.azure.com/chat/threads/19:meeting_453dafb77b26481ea2e73bcada0324af@thread.v2/images/0-canaryeus-d1-907ca0083e8f3bef6793e5a46c0ded73/views/original?api-version=2023-07-01-preview",
            "previewUrl": "https://contoso.westus.communications.azure.com/chat/threads/19:meeting_453dafb77b26481ea2e73bcada0324af@thread.v2/messages/1700844519132/teamsInterop/images/0-canaryeus-d1-907ca0083e8f3bef6793e5a46c0ded73/views/small?api-version=2023-07-01-preview"
          }
        ]
      },
      "senderDisplayName": "Jane",
      "createdOn": "2020-06-25T17:44:37.6830000Z",
      "metadata": {
        "amsreferences": "[\"0-canaryeus-d1-907ca0083e8f3bef6793e5a46c0ded73\"]"
      },
      "senderCommunicationIdentifier": {
        "rawId": "8540c0de-899f-5cce-acb5-3ec493af3800_0e59221d-0c1d-46ae-9544-c963ce56c10b",
        "communicationUser": {
          "id": "8540c0de-899f-5cce-acb5-3ec493af3800_0e59221d-0c1d-46ae-9544-c963ce56c10b"
        }
      }
    },
    {
      "id": "1593107077683",
      "type": "text",
      "sequenceId": "4",
      "version": "1593107077683",
      "content": {
        "message": "Let's use this chat to decide what to get for lunch today."
      },
      "senderDisplayName": "Jane",
      "createdOn": "2020-06-25T17:44:37.6830000Z",
      "senderCommunicationIdentifier": {
        "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"
        }
      }
    },
    {
      "id": "1593107046498",
      "type": "text",
      "sequenceId": "3",
      "version": "1593107046498",
      "content": {
        "message": "Good morning everyone!"
      },
      "senderDisplayName": "Jane",
      "createdOn": "2020-06-25T17:44:06.4980000Z",
      "senderCommunicationIdentifier": {
        "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"
        }
      }
    },
    {
      "id": "1593106976785",
      "type": "topicUpdated",
      "sequenceId": "2",
      "version": "1593106976785",
      "content": {
        "initiatorCommunicationIdentifier": {
          "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"
          }
        },
        "topic": "Lunch"
      },
      "createdOn": "2020-06-25T17:42:56.7850000Z"
    },
    {
      "id": "1593106976753",
      "type": "participantAdded",
      "version": "1593106976753",
      "sequenceId": "1",
      "content": {
        "initiatorCommunicationIdentifier": {
          "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"
          }
        },
        "participants": [
          {
            "communicationIdentifier": {
              "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"
              }
            }
          },
          {
            "communicationIdentifier": {
              "rawId": "8:acs:8540c0de-899f-5cce-acb5-3ec493af3800_c94ff260-162d-46d6-94fd-e79f4d213715",
              "communicationUser": {
                "id": "8:acs:8540c0de-899f-5cce-acb5-3ec493af3800_c94ff260-162d-46d6-94fd-e79f4d213715"
              }
            }
          },
          {
            "communicationIdentifier": {
              "rawId": "8:acs:8540c0de-899f-5cce-acb5-3ec493af3800_f13a9208-0bb8-45c0-916c-f3ed922728ce",
              "communicationUser": {
                "id": "8:acs:8540c0de-899f-5cce-acb5-3ec493af3800_f13a9208-0bb8-45c0-916c-f3ed922728ce"
              }
            }
          }
        ]
      },
      "createdOn": "2020-06-25T17:42:56.7530000Z"
    }
  ],
  "nextLink": "https://contoso.westus.communications.azure.com/chat/threads/19:meeting_453dafb77b26481ea2e73bcada0324af@thread.v2/messages?syncState=3e4700000031393a756e6930315f7a626e68336e74326466756666657a6333736f7837646f67377766686b36793571653272776c6e66686c68647a69726968647071407468726561642e763201451fe6e77201000004357fea72010000&startTime=0&maxPageSize=5&api-version=2024-03-15-preview"
}
{
  "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."
  }
}

정의

Name Description
ChatAttachment

채팅 메시지의 첨부 파일입니다. 현재 Teams Interop 시나리오에서만 지원됩니다.

ChatAttachmentType

첨부 파일의 형식입니다.

ChatMessage

채팅 메시지.

ChatMessageContent

채팅 메시지의 콘텐츠입니다.

ChatMessagesCollection

특정 채팅 스레드에 대한 채팅 메시지 컬렉션입니다.

ChatMessageType

채팅 메시지 유형입니다.

ChatParticipant

채팅 스레드의 참가자입니다.

ChatAttachment

채팅 메시지의 첨부 파일입니다. 현재 Teams Interop 시나리오에서만 지원됩니다.

Name 형식 Description
attachmentType

ChatAttachmentType

첨부 파일의 형식입니다.

id

string

첨부 파일의 ID

name

string

첨부 파일 콘텐츠의 이름입니다.

previewUrl

string

첨부 파일의 미리 보기를 다운로드할 수 있는 URL

url

string

첨부 파일을 다운로드할 수 있는 URL

ChatAttachmentType

첨부 파일의 형식입니다.

Name 형식 Description
file

string

image

string

ChatMessage

채팅 메시지.

Name 형식 Description
content

ChatMessageContent

채팅 메시지의 콘텐츠입니다.

createdOn

string

채팅 메시지가 서버에 도착한 타임스탬프입니다. 타임스탬프는 RFC3339 형식 yyyy-MM-ddTHH:mm:ssZ입니다.

deletedOn

string

메시지가 삭제된 타임스탬프(해당하는 경우)입니다. 타임스탬프는 RFC3339 형식 yyyy-MM-ddTHH:mm:ssZ입니다.

editedOn

string

메시지가 편집된 마지막 타임스탬프(해당하는 경우)입니다. 타임스탬프는 RFC3339 형식 yyyy-MM-ddTHH:mm:ssZ입니다.

id

string

채팅 메시지의 ID입니다. 이 ID는 서버가 생성됩니다.

metadata

object

메시지 메타데이터.

senderCommunicationIdentifier

CommunicationIdentifierModel

senderDisplayName

string

채팅 메시지 보낸 사람의 표시 이름입니다. 이 속성은 푸시 알림의 보낸 사람 이름을 채우는 데 사용됩니다.

sequenceId

string

대화의 채팅 메시지 시퀀스입니다.

type

ChatMessageType

채팅 메시지 유형입니다.

version

string

채팅 메시지의 버전입니다.

ChatMessageContent

채팅 메시지의 콘텐츠입니다.

Name 형식 Description
attachments

ChatAttachment[]

이 메시지의 첨부 파일 목록

initiatorCommunicationIdentifier

CommunicationIdentifierModel

message

string

텍스트 또는 html 형식의 메시지에 대한 채팅 메시지 콘텐츠입니다.

participants

ChatParticipant[]

참가자 형식의 메시지에 대한 채팅 메시지 콘텐츠추가됨 또는 참가자리모브됨.

topic

string

topicUpdated 형식의 메시지에 대한 채팅 메시지 콘텐츠입니다.

ChatMessagesCollection

특정 채팅 스레드에 대한 채팅 메시지 컬렉션입니다.

Name 형식 Description
nextLink

string

검색할 수 있는 채팅 메시지가 더 많은 경우 다음 링크가 채워집니다.

value

ChatMessage[]

채팅 메시지의 컬렉션입니다.

ChatMessageType

채팅 메시지 유형입니다.

Name 형식 Description
html

string

participantAdded

string

participantRemoved

string

text

string

topicUpdated

string

ChatParticipant

채팅 스레드의 참가자입니다.

Name 형식 Description
communicationIdentifier

CommunicationIdentifierModel

displayName

string

채팅 참가자의 표시 이름입니다.

metadata

object

채팅 참가자에 대한 컨텍스트 메타데이터입니다. 메타데이터는 이름/값 쌍으로 구성됩니다. 모든 메타데이터 쌍의 총 크기는 최대 1KB일 수 있습니다.

shareHistoryTime

string

채팅 기록이 참가자와 공유되는 시간입니다. 타임스탬프는 RFC3339 형식 yyyy-MM-ddTHH:mm:ssZ입니다.