次の方法で共有


Chat Thread - Get Chat Message

ID でメッセージを取得します。

GET {endpoint}/chat/threads/{chatThreadId}/messages/{chatMessageId}?api-version=2025-03-15

URI パラメーター

名前 / 必須 説明
chatMessageId
path True

string

メッセージ ID。

chatThreadId
path True

string

メッセージが送信されたスレッド ID。

endpoint
path True

string

Azure Communication リソースのエンドポイント。

api-version
query True

string

呼び出す API のバージョン。

要求ヘッダー

名前 必須 説明
Authorization True

string

ACS (Azure Communication Services) ユーザー アクセス トークン。

応答

名前 説明
200 OK

ChatMessage

要求が成功しました。 このアクションは、Message リソースを返します。

401 Unauthorized

CommunicationErrorResponse

許可されていません。

403 Forbidden

CommunicationErrorResponse

禁じられた。

429 Too Many Requests

CommunicationErrorResponse

要求が多すぎます。

Other Status Codes

CommunicationErrorResponse

サービスを使用できません。

セキュリティ

Authorization

ACS (Azure Communication Services) ユーザー アクセス トークン。

型: apiKey
/: header

Get Message

要求のサンプル

GET https://contoso.westus.communications.azure.com/chat/threads/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/messages/1591768249318?api-version=2025-03-15

応答のサンプル

{
  "id": "1591768249318",
  "sequenceId": "1",
  "type": "text",
  "version": "1599016601134",
  "content": {
    "message": "Let's head out for lunch in 15 minutes."
  },
  "senderDisplayName": "Jane",
  "createdOn": "2020-06-10T05:50:49.3180000Z",
  "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"
    }
  },
  "metadata": {
    "someKey1": "someValue1",
    "someKey2": "someValue2"
  }
}
{
  "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."
  }
}

定義

名前 説明
ChatAttachment

チャット メッセージの添付ファイル。

ChatAttachmentType

添付ファイルの種類。

ChatMessage

チャット メッセージ。

ChatMessageContent

チャット メッセージの内容。

ChatMessageType

チャット メッセージの種類。

ChatParticipant

チャット スレッドの参加者。

ChatAttachment

チャット メッセージの添付ファイル。

名前 説明
attachmentType

ChatAttachmentType

添付ファイルの種類。

id

string

添付ファイルの ID

name

string

添付ファイルのコンテンツの名前。

previewUrl

string (uri)

添付ファイルのプレビューをダウンロードできる URL

url

string (uri)

添付ファイルをダウンロードできる URL

ChatAttachmentType

添付ファイルの種類。

説明
image
file

ChatMessage

チャット メッセージ。

名前 説明
content

ChatMessageContent

チャット メッセージの内容。

createdOn

string (date-time)

チャット メッセージがサーバーに到着したときのタイムスタンプ。 タイムスタンプは yyyy-MM-ddTHH:mm:ssZRFC3339 形式です。

deletedOn

string (date-time)

メッセージが削除されたときのタイムスタンプ (該当する場合)。 タイムスタンプは yyyy-MM-ddTHH:mm:ssZRFC3339 形式です。

editedOn

string (date-time)

メッセージが編集されたときの最後のタイムスタンプ (該当する場合)。 タイムスタンプは yyyy-MM-ddTHH:mm:ssZRFC3339 形式です。

id

string

チャット メッセージの ID。 この ID はサーバーによって生成されます。

metadata

object

メッセージ メタデータ。

senderCommunicationIdentifier

CommunicationIdentifierModel

senderDisplayName

string

チャット メッセージ送信者の表示名。 このプロパティは、プッシュ通知の送信者名を設定するために使用されます。

sequenceId

string

会話内のチャット メッセージのシーケンス。

type

ChatMessageType

チャット メッセージの種類。

version

string

チャット メッセージのバージョン。

ChatMessageContent

チャット メッセージの内容。

名前 説明
attachments

ChatAttachment[]

このメッセージの添付ファイルの一覧

initiatorCommunicationIdentifier

CommunicationIdentifierModel

message

string

テキストまたは html 型のメッセージのチャット メッセージ コンテンツ。

participants

ChatParticipant[]

種類 participantAdded または participantRemoved のメッセージのチャット メッセージ コンテンツ。

topic

string

topicUpdated 型のメッセージのチャット メッセージ コンテンツ。

ChatMessageType

チャット メッセージの種類。

説明
text
html
topicUpdated
participantAdded
participantRemoved

ChatParticipant

チャット スレッドの参加者。

名前 説明
communicationIdentifier

CommunicationIdentifierModel

displayName

string

チャット参加者の表示名。

metadata

object

チャット参加者のコンテキスト メタデータ。 メタデータは、名前と値のペアで構成されます。 すべてのメタデータ ペアの合計サイズは、最大 1 KB です。

shareHistoryTime

string (date-time)

チャット履歴が参加者と共有される時間。 タイムスタンプは yyyy-MM-ddTHH:mm:ssZRFC3339 形式です。