Chat Thread - Send Chat Message
スレッドにメッセージを送信します。
POST {endpoint}/chat/threads/{chatThreadId}/messages?api-version=2024-03-15-preview
URI パラメーター
名前 | / | 必須 | 型 | 説明 |
---|---|---|---|---|
chat
|
path | True |
string |
メッセージを送信するスレッド ID。 |
endpoint
|
path | True |
string |
Azure Communication リソースのエンドポイント。 |
api-version
|
query | True |
string |
呼び出す API のバージョン。 |
要求ヘッダー
名前 | 必須 | 型 | 説明 |
---|---|---|---|
Authorization | True |
string |
ACS (Azure Communication Services) ユーザー アクセス トークン。 |
要求本文
名前 | 必須 | 型 | 説明 |
---|---|---|---|
content | True |
string |
チャット メッセージの内容。 |
attachments |
添付ファイルの配列 |
||
metadata |
object |
メッセージ メタデータ。 |
|
senderDisplayName |
string |
チャット メッセージ送信者の表示名。 このプロパティは、プッシュ通知の送信者名を設定するために使用されます。 |
|
type |
チャット メッセージの種類。 |
応答
名前 | 型 | 説明 |
---|---|---|
201 Created |
送信されたメッセージ。 |
|
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
例
Send Message
Sample Request
POST https://contoso.westus.communications.azure.com/chat/threads/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/messages?api-version=2024-03-15-preview
{
"content": "Let's head out for lunch in 15 minutes.",
"senderDisplayName": "Jane",
"metadata": {
"someKey1": "someValue1",
"someKey2": "someValue2"
}
}
Sample Response
Location: https://contoso.westus.communications.azure.com/chat/threads/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/messages/1593072104708
{
"id": "1593072104708"
}
{
"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 |
チャット メッセージの種類。 |
Send |
送信するメッセージの詳細。 |
Send |
メッセージ送信操作の結果。 |
ChatAttachment
チャット メッセージの添付ファイル。 現在、Teams 相互運用シナリオでのみサポートされています。
名前 | 型 | 説明 |
---|---|---|
attachmentType |
添付ファイルの種類。 |
|
id |
string |
添付ファイルの ID |
name |
string |
添付ファイルの内容の名前。 |
previewUrl |
string |
添付ファイルのプレビューをダウンロードできる URL |
url |
string |
添付ファイルをダウンロードできる URL |
ChatAttachmentType
添付ファイルの種類。
名前 | 型 | 説明 |
---|---|---|
file |
string |
|
image |
string |
ChatMessageType
チャット メッセージの種類。
名前 | 型 | 説明 |
---|---|---|
html |
string |
|
participantAdded |
string |
|
participantRemoved |
string |
|
text |
string |
|
topicUpdated |
string |
SendChatMessageRequest
送信するメッセージの詳細。
名前 | 型 | 説明 |
---|---|---|
attachments |
添付ファイルの配列 |
|
content |
string |
チャット メッセージの内容。 |
metadata |
object |
メッセージ メタデータ。 |
senderDisplayName |
string |
チャット メッセージ送信者の表示名。 このプロパティは、プッシュ通知の送信者名を設定するために使用されます。 |
type |
チャット メッセージの種類。 |
SendChatMessageResult
メッセージ送信操作の結果。
名前 | 型 | 説明 |
---|---|---|
id |
string |
サーバーによって生成されたメッセージ ID。 |