Créer une salle de réunion à long terme

Cet extrait de code montre comment créer une salle de réunion à long terme à 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.

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.

Rédiger le code

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

Voir la source complète

Exécutez votre code

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

sh create-long-term-room.sh

Exemple de réponse

Votre chambre à long terme a été créée.

Vous recevrez une réponse similaire à la suivante :

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