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 パラメーター
名前 | / | 必須 | 型 | 説明 |
---|---|---|---|---|
chat
|
path | True |
string |
メッセージのスレッド ID。 |
endpoint
|
path | True |
string |
Azure Communication リソースのエンドポイント。 |
api-version
|
query | True |
string |
呼び出す API のバージョン。 |
max
|
query |
integer int32 |
ページごとに返されるメッセージの最大数。 |
|
start
|
query |
string date-time |
メッセージを取得する最も早い時点。 タイムスタンプは RFC3339 形式にする必要があります。 |
要求ヘッダー
名前 | 必須 | 型 | 説明 |
---|---|---|---|
Authorization | True |
string |
ACS (Azure Communication Services) ユーザー アクセス トークン。 |
応答
名前 | 型 | 説明 |
---|---|---|
200 OK |
Success |
|
401 Unauthorized |
Communication |
権限がありません。 |
403 Forbidden |
Communication |
Forbidden. |
429 Too Many Requests |
Communication |
要求が多すぎます。 |
Other Status Codes |
Communication |
Service unavailable. (サービス利用不可。) |
セキュリティ
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? </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."
}
}
定義
名前 | 説明 |
---|---|
Chat |
チャット メッセージ内の添付ファイル。 現在、Teams 相互運用シナリオでのみサポートされています。 |
Chat |
添付ファイルの種類。 |
Chat |
チャット メッセージ。 |
Chat |
チャット メッセージの内容。 |
Chat |
特定のチャット スレッドのチャット メッセージのコレクション。 |
Chat |
チャット メッセージの種類。 |
Chat |
チャット スレッドの参加者。 |
ChatAttachment
チャット メッセージ内の添付ファイル。 現在、Teams 相互運用シナリオでのみサポートされています。
名前 | 型 | 説明 |
---|---|---|
attachmentType |
添付ファイルの種類。 |
|
id |
string |
添付ファイルの ID |
name |
string |
添付ファイルの内容の名前。 |
previewUrl |
string |
添付ファイルのプレビューをダウンロードできる URL |
url |
string |
添付ファイルをダウンロードできる URL |
ChatAttachmentType
添付ファイルの種類。
名前 | 型 | 説明 |
---|---|---|
file |
string |
|
image |
string |
ChatMessage
チャット メッセージ。
名前 | 型 | 説明 |
---|---|---|
content |
チャット メッセージの内容。 |
|
createdOn |
string |
チャット メッセージがサーバーに到着したときのタイムスタンプ。 タイムスタンプの形式は RFC3339 です。 |
deletedOn |
string |
メッセージが削除されたときのタイムスタンプ (該当する場合)。 タイムスタンプの形式は RFC3339 です。 |
editedOn |
string |
メッセージが編集された最後のタイムスタンプ (該当する場合)。 タイムスタンプの形式は RFC3339 です。 |
id |
string |
チャット メッセージの ID。 この ID はサーバーによって生成されます。 |
metadata |
object |
メッセージ メタデータ。 |
senderCommunicationIdentifier |
Communication |
|
senderDisplayName |
string |
チャット メッセージ送信者の表示名。 このプロパティは、プッシュ通知の送信者名を設定するために使用されます。 |
sequenceId |
string |
会話内のチャット メッセージのシーケンス。 |
type |
チャット メッセージの種類。 |
|
version |
string |
チャット メッセージのバージョン。 |
ChatMessageContent
チャット メッセージの内容。
名前 | 型 | 説明 |
---|---|---|
attachments |
このメッセージの添付ファイルの一覧 |
|
initiatorCommunicationIdentifier |
Communication |
|
message |
string |
テキストまたは html 型のメッセージのチャット メッセージ コンテンツ。 |
participants |
種類が participantAdded または participantRemoved のメッセージのチャット メッセージ コンテンツ。 |
|
topic |
string |
topicUpdated 型のメッセージのチャット メッセージ コンテンツ。 |
ChatMessagesCollection
特定のチャット スレッドのチャット メッセージのコレクション。
名前 | 型 | 説明 |
---|---|---|
nextLink |
string |
取得できるチャット メッセージがさらに存在する場合は、次のリンクが設定されます。 |
value |
チャット メッセージのコレクション。 |
ChatMessageType
チャット メッセージの種類。
名前 | 型 | 説明 |
---|---|---|
html |
string |
|
participantAdded |
string |
|
participantRemoved |
string |
|
text |
string |
|
topicUpdated |
string |
ChatParticipant
チャット スレッドの参加者。
名前 | 型 | 説明 |
---|---|---|
communicationIdentifier |
Communication |
|
displayName |
string |
チャット参加者の表示名。 |
metadata |
object |
チャット参加者のコンテキスト メタデータ。 メタデータは、名前と値のペアで構成されます。 すべてのメタデータ ペアの合計サイズは最大 1 KB です。 |
shareHistoryTime |
string |
チャット履歴が参加者と共有される時間。 タイムスタンプの形式は RFC3339 です。 |