Share via


Chat Thread - Add Chat Participants

スレッド参加者をスレッドに追加します。 参加者が既に存在する場合、変更は行われません。

POST {endpoint}/chat/threads/{chatThreadId}/participants/:add?api-version=2024-03-15-preview

URI パラメーター

名前 / 必須 説明
chatThreadId
path True

string

参加者を追加するスレッドの ID。

endpoint
path True

string

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

api-version
query True

string

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

要求ヘッダー

名前 必須 説明
Authorization True

string

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

要求本文

名前 必須 説明
participants True

ChatParticipant[]

チャット スレッドに追加する参加者。

応答

名前 説明
201 Created

AddChatParticipantsResult

参加者が正常に追加されました。

401 Unauthorized

CommunicationErrorResponse

権限がありません。

403 Forbidden

CommunicationErrorResponse

Forbidden.

429 Too Many Requests

CommunicationErrorResponse

要求が多すぎます。

Other Status Codes

CommunicationErrorResponse

Service unavailable. (サービス利用不可。)

セキュリティ

Authorization

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

Type: apiKey
In: header

Add participants

Sample Request

POST https://contoso.westus.communications.azure.com/chat/threads/19:f2167429acf6482880c6b7790a9086c1@thread.v2/participants/:add?api-version=2024-03-15-preview

{
  "participants": [
    {
      "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"
        }
      },
      "displayName": "Alex",
      "shareHistoryTime": "2020-06-06T05:55:41Z"
    },
    {
      "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"
        }
      },
      "displayName": "Peter",
      "shareHistoryTime": "2020-06-06T05:55:41Z"
    },
    {
      "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"
        }
      },
      "displayName": "Rama",
      "shareHistoryTime": "2020-06-06T05:55:41Z"
    }
  ]
}

Sample Response

{
  "invalidParticipants": [
    {
      "target": "8:acs:8540c0de-899f-5cce-acb5-3ec493af3800_a34d2d65-d72f-4c48-a12c-2d5c9ac75a1a",
      "code": "403",
      "message": "Permissions check failed"
    },
    {
      "target": "8:acs:8540c0de-899f-5cce-acb5-3ec493af3800_f6762773-e33a-4727-985f-50bd1d197c7b",
      "code": "404",
      "message": "Not found"
    }
  ]
}
{
  "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."
  }
}

定義

名前 説明
AddChatParticipantsRequest

スレッドに追加する参加者。

AddChatParticipantsResult

チャット参加者の追加操作の結果。

ChatParticipant

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

AddChatParticipantsRequest

スレッドに追加する参加者。

名前 説明
participants

ChatParticipant[]

チャット スレッドに追加する参加者。

AddChatParticipantsResult

チャット参加者の追加操作の結果。

名前 説明
invalidParticipants

CommunicationError[]

チャット スレッドに追加できなかった参加者。

ChatParticipant

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

名前 説明
communicationIdentifier

CommunicationIdentifierModel

displayName

string

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

metadata

object

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

shareHistoryTime

string

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