Partager via


Chat Thread - Add Chat Participants

Ajoute des participants de thread à un thread. Si des participants existent déjà, aucune modification n’a lieu.

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

Paramètres URI

Nom Dans Obligatoire Type Description
chatThreadId
path True

string

ID du thread à lequel ajouter des participants.

endpoint
path True

string

Point de terminaison de la ressource Azure Communication.

api-version
query True

string

Version de l’API à appeler.

En-tête de la demande

Nom Obligatoire Type Description
Authorization True

string

Jeton d’accès utilisateur ACS (Azure Communication Services).

Corps de la demande

Nom Obligatoire Type Description
participants True

ChatParticipant[]

Participants à ajouter à un fil de conversation.

Réponses

Nom Type Description
201 Created

AddChatParticipantsResult

Les participants ont été ajoutés avec succès.

401 Unauthorized

CommunicationErrorResponse

Non autorisé.

403 Forbidden

CommunicationErrorResponse

Interdit.

429 Too Many Requests

CommunicationErrorResponse

Trop grand nombre de requêtes.

Other Status Codes

CommunicationErrorResponse

Service indisponible.

Sécurité

Authorization

Jeton d’accès utilisateur ACS (Azure Communication Services).

Type: apiKey
Dans: header

Exemples

Add participants

Exemple de requête

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

Exemple de réponse

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

Définitions

Nom Description
AddChatParticipantsRequest

Participants à ajouter au thread.

AddChatParticipantsResult

Résultat de l’opération d’ajout de participants à la conversation.

ChatParticipant

Un participant du fil de conversation.

AddChatParticipantsRequest

Participants à ajouter au thread.

Nom Type Description
participants

ChatParticipant[]

Participants à ajouter à un fil de conversation.

AddChatParticipantsResult

Résultat de l’opération d’ajout de participants à la conversation.

Nom Type Description
invalidParticipants

CommunicationError[]

Participants qui n’ont pas pu être ajoutés au fil de conversation.

ChatParticipant

Un participant du fil de conversation.

Nom Type Description
communicationIdentifier

CommunicationIdentifierModel

displayName

string

Nom d’affichage du participant à la conversation.

metadata

object

Métadonnées contextuelles pour le participant à la conversation. Les métadonnées se composent de paires nom/valeur. La taille totale de toutes les paires de métadonnées peut atteindre 1 Ko.

shareHistoryTime

string

Heure à partir de laquelle l’historique de conversation est partagé avec le participant. L’horodatage est au format RFC3339 : yyyy-MM-ddTHH:mm:ssZ.