Delen via


Chat Thread - Add Chat Participants

Voegt threaddeelnemers toe aan een thread. Als er al deelnemers bestaan, treedt er geen wijziging op.

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

URI-parameters

Name In Vereist Type Description
chatThreadId
path True

string

Id van de thread waaraan deelnemers moeten worden toegevoegd.

endpoint
path True

string

Het eindpunt van de Azure Communication-resource.

api-version
query True

string

De versie van de API die moet worden aangeroepen.

Aanvraagkoptekst

Name Vereist Type Description
Authorization True

string

Een ACS-gebruikerstoegangstoken (Azure Communication Services).

Aanvraagbody

Name Vereist Type Description
participants True

ChatParticipant[]

Deelnemers die moeten worden toegevoegd aan een chatgesprek.

Antwoorden

Name Type Description
201 Created

AddChatParticipantsResult

De deelnemers zijn toegevoegd.

401 Unauthorized

CommunicationErrorResponse

Ongeoorloofd.

403 Forbidden

CommunicationErrorResponse

Verboden.

429 Too Many Requests

CommunicationErrorResponse

Te veel aanvragen.

Other Status Codes

CommunicationErrorResponse

De service is niet beschikbaar.

Beveiliging

Authorization

Een ACS-gebruikerstoegangstoken (Azure Communication Services).

Type: apiKey
In: header

Voorbeelden

Add participants

Voorbeeldaanvraag

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

{
  "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"
    }
  ]
}

Voorbeeldrespons

{
  "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."
  }
}

Definities

Name Description
AddChatParticipantsRequest

Deelnemers die aan de thread moeten worden toegevoegd.

AddChatParticipantsResult

Resultaat van de bewerking chatdeelnemers toevoegen.

ChatParticipant

Een deelnemer aan de chat-thread.

AddChatParticipantsRequest

Deelnemers die aan de thread moeten worden toegevoegd.

Name Type Description
participants

ChatParticipant[]

Deelnemers die moeten worden toegevoegd aan een chatgesprek.

AddChatParticipantsResult

Resultaat van de bewerking chatdeelnemers toevoegen.

Name Type Description
invalidParticipants

CommunicationError[]

De deelnemers die niet aan de chatthread konden worden toegevoegd.

ChatParticipant

Een deelnemer aan de chat-thread.

Name Type Description
communicationIdentifier

CommunicationIdentifierModel

displayName

string

Weergavenaam voor de chatdeelnemer.

shareHistoryTime

string (date-time)

Tijd van waaruit de chatgeschiedenis wordt gedeeld met de deelnemer. De tijdstempel heeft RFC3339 indeling: yyyy-MM-ddTHH:mm:ssZ.