Créer une salle de réunion instantanée

Cet extrait de code montre comment créer une salle instantanée (par défaut) à l'aide de l'API Meetings.

Voir le Référence API pour plus d'informations.

Exemple de demande

Le cas échéant, remplacez les variables suivantes dans l'exemple de code par vos propres valeurs :

CléDescription
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.

Rédiger le code

Ajouter ce qui suit à 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'"
   }'

Voir la source complète

Exécutez votre code

Enregistrez ce fichier sur votre machine et exécutez-le :

sh create-instant-room.sh

Exemple de réponse

Votre chambre instantanée a été créée.

Lorsqu'une salle instantanée est créée, la date d'expiration est fixée à 10 minutes.

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