Compartir a través de


Chat Thread - Add Chat Participants

Agrega participantes de subprocesos a un subproceso. Si los participantes ya existen, no se produce ningún cambio.

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

Parámetros de identificador URI

Nombre En Requerido Tipo Description
chatThreadId
path True

string

Identificador del subproceso al que se van a agregar participantes.

endpoint
path True

string

Punto de conexión del recurso de Comunicación de Azure.

api-version
query True

string

Versión de la API que se va a invocar.

Encabezado de la solicitud

Nombre Requerido Tipo Description
Authorization True

string

Un token de acceso de usuario de ACS (Azure Communication Services).

Cuerpo de la solicitud

Nombre Requerido Tipo Description
participants True

ChatParticipant[]

Participantes que se van a agregar a una conversación de chat.

Respuestas

Nombre Tipo Description
201 Created

AddChatParticipantsResult

Los participantes se agregaron correctamente.

401 Unauthorized

CommunicationErrorResponse

No autorizado.

403 Forbidden

CommunicationErrorResponse

Prohibido.

429 Too Many Requests

CommunicationErrorResponse

Demasiadas solicitudes.

Other Status Codes

CommunicationErrorResponse

Servicio no disponible.

Seguridad

Authorization

Un token de acceso de usuario de ACS (Azure Communication Services).

Tipo: apiKey
En: header

Ejemplos

Add participants

Solicitud de ejemplo

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

Respuesta de muestra

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

Definiciones

Nombre Description
AddChatParticipantsRequest

Participantes que se van a agregar al subproceso.

AddChatParticipantsResult

Resultado de la operación agregar participantes del chat.

ChatParticipant

Participante del subproceso de chat.

AddChatParticipantsRequest

Participantes que se van a agregar al subproceso.

Nombre Tipo Description
participants

ChatParticipant[]

Participantes que se van a agregar a una conversación de chat.

AddChatParticipantsResult

Resultado de la operación agregar participantes del chat.

Nombre Tipo Description
invalidParticipants

CommunicationError[]

Los participantes que no se pudieron agregar al subproceso de chat.

ChatParticipant

Participante del subproceso de chat.

Nombre Tipo Description
communicationIdentifier

CommunicationIdentifierModel

displayName

string

Nombre para mostrar del participante del chat.

metadata

object

Metadatos contextuales para el participante del chat. Los metadatos constan de pares nombre-valor. El tamaño total de todos los pares de metadatos puede tener un tamaño de hasta 1 KB.

shareHistoryTime

string

Hora a partir de la cual se comparte el historial de chat con el participante. La marca de tiempo está en formato RFC3339: yyyy-MM-ddTHH:mm:ssZ.