Crear una sala de reuniones a largo plazo

Este fragmento de código muestra cómo crear una sala de reuniones de larga duración 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.

EXPIRATION_DATE

The time for when the room will be expired, expressed in ISO 8601 format. Required only for long-term room creation.

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-long-term-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'",
      "type":"long_term",
      "expires_at":"'$EXPIRATION_DATE'"
  }'

Ver fuente completa

Ejecute su código

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

sh create-long-term-room.sh

Ejemplo de respuesta

Su Sala de Larga Duración ha sido creada.

Recibirá una respuesta similar a la siguiente:

{
    "id": "bc41d742-b336-4bf6-8643-aa97b5f5025c",
    "display_name": "New Meeting Room",
    "metadata": null,
    "type": "long_term",
    "expires_at": "2022-10-21T18:45:50.901Z",
    "join_approval_level": "abc123",
    "recording_options": {
        "auto_record": true
    },
    "meeting_code": "117744699",
    "_links": {
        "host_url": {
            "href": "https://meetings.vonage.com/?room_token=117744699&participant_token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCIsImtpZCI6IjYyNjdkNGE5LTlmMTctNGVkYi05MzBmLTJlY2FmMThjODdjOSJ9.eyJwYXJ0aWNpcGFudElkIjoiZmVlNDVmMDItMDhmOC00ZTdmLWE1MjAtZmYwYjYyZGI2NWM3IiwiaWF0IjoxNjM0NjY3NzQ1fQ.CDHtC3nW2B_jIXhfRTPzznH1j7kzcH3-gbL5h9bxIEE"
        },
        "guest_url": {
            "href": "https://meetings.vonage.com/117744699"
        }
    },
    "created_at": "2022-10-19T18:22:24.965Z",
    "is_available": true,
    "expire_after_use": false,
    "theme_id": "e8b1d80b-8f78-4578-94f2-328596e01387",
    "initial_join_options": {
        "microphone_state": "default"
}