Crear una sala de reuniones instantánea

Este fragmento de código muestra cómo crear una sala instantánea (predeterminada) utilizando la Meetings API.

Véase el Referencia API para más información.

Ejemplo de solicitud

Cuando sea necesario, sustituya las siguientes variables del código de ejemplo por sus propios valores:

ClaveDescripción
JWT

Used to authenticate your request. See Authentication for more information, including how to generate a JWT.

ROOM_DISPLAY_NAME

The name of the meeting room.

VONAGE_APPLICATION_ID

The Vonage Application ID.

VONAGE_APPLICATION_PRIVATE_KEY_PATH

Private key path.

Escriba el código

Añada lo siguiente a create-instant-room.sh:

curl -X POST https://api-eu.vonage.com/meetings/rooms \
  -H "Authorization: Bearer $JWT" \
  -H "Content-Type: application/json" \
  -d '{
      "display_name":"'$ROOM_DISPLAY_NAME'"
   }'

Ver fuente completa

Ejecute su código

Guarde este archivo en su máquina y ejecútelo:

sh create-instant-room.sh

Ejemplo de respuesta

Tu Instant Room ha sido creada.

Cuando se crea una sala instantánea, la fecha de caducidad se establece en 10 minutos.

{
   "id":"a66e451f-794c-460a-b95a-cd60f5dbdc1a",
   "display_name":"New Meeting Room",
   "metadata":null,
   "type":"instant",
   "expires_at":"2021-10-19T17:54:17.219Z",
   "expire_after_use": false,
   "join_approval_level": "abc123",
   "recording_options":{
      "auto_record":false,
      "record_only_owner":false
   },
   "meeting_code":"982515622",
   "_links":{
      "host_url":{
         "href":"https://meetings.vonage.com/?room_token=982515622&participant_token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCIsImtpZCI6IjYyNjdkNGE5LTlmMTctNGVkYi05MzBmLTJlY2FmMThjODdj3BK7.eyJwYXJ0aWNpcGFudElkIjoiODNjNjQxNTQtYWJjOC00NTBkLTk1MmYtY2U4MWRmYWZiZDNkIiwiaWF0IjoxNjM0NjY1NDU3fQ.PmNtAWw5o4QtGiyQB0QVeq_qcl6fs0buGMx5t4Fy43c"
      },
      "guest_url":{
         "href":"https://meetings.vonage.com/982515622"
      }
   },
   "created_at":"2021-10-19T17:44:17.220Z",
   "is_available":true
}