L'étiquette blanche : Gestion des thèmes pour les salles de réunion
Utilisez l'API Meetings pour créer des thèmes personnalisés avec des couleurs, des logos et du texte différents. Les thèmes peuvent être appliqués à une salle, à quelques salles ou à toutes les salles de réunion de votre application.
Conditions préalables
Compte de développeur Vonage: Si vous n'en possédez pas déjà un, créez un compte gratuit sur le site de la Commission européenne. Compte des développeurs de Vonage.
ID et secret de l'application: Une fois que vous êtes connecté à l'application Tableau de bord de l'API VonageCliquez sur Applications et créez une nouvelle application. Cliquez sur
Generate public and private keyet enregistrez la clé privée. Vous utiliserez la clé privée avec l'identifiant de l'Application pour Générer un jeton Web JSON (JWT). Pour plus de détails sur les JWT, voir Authentification. Assurez-vous également que l'API Meetings est activée pour votre application sous "Capacités" :

Créer un thème
https://api-eu.vonage.com/v1/meetings/themes
Contenu du corps
Les champs suivants peuvent se voir attribuer des valeurs dans la requête POST :
| Champ d'application | Nécessaire ? | Description |
|---|---|---|
theme_name | Non | Le nom du thème (doit être unique). S'il est nul, un UUID sera automatiquement généré. |
main_color | Oui | La couleur principale qui sera utilisée pour la salle de réunion. |
brand_text | Oui | Le texte qui apparaîtra sur la page d'accueil de la réunion, dans le cas où il n'y a pas d'image de marque. |
short_company_url | Non | L'URL qui représentera chaque salle de réunion avec ce thème (doit être unique). |
Exemple de demande
L'exemple suivant crée un thème dont la couleur principale est l'orange et dont le texte affiché est "Orange". Le nom du thème est utilisé en interne et doit être unique pour chaque thème.
const credentials = new Auth({
privateKey: VONAGE_APPLICATION_PRIVATE_KEY_PATH,
applicationId: VONAGE_APPLICATION_ID,
});
const options = {};
const meetingsClient = new Meetings(credentials, options);
await meetingsClient.createTheme({
themeName: "orange-room",
mainColor: '#ff6500',
brand: "Orange",
});
var client = VonageClient.builder()
.applicationId(VONAGE_APPLICATION_ID)
.privateKeyPath(VONAGE_PRIVATE_KEY_PATH)
.build();
var theme = Theme.builder()
.mainColor("#ff6500")
.brandText("Orange")
.themeName("orange-room")
.build();
client.getMeetingsClient().createTheme(theme);
var credentials = Credentials.FromAppIdAndPrivateKeyPath(applicationId, privateKeyPath);
var client = new VonageClient(credentials);
var request = CreateThemeRequest.Build()
.WithBrand("Orange")
.WithColor(Color.FromName("#ff6500"))
.WithName("orange-room")
.Create();
var response = await client.MeetingsClient.CreateThemeAsync(request);
$keypair = new Vonage\Client\Keypair(
VONAGE_APPLICATION_PRIVATE_KEY_PATH
VONAGE_APPLICATION_ID,
);
$client = new Vonage\Client($keypair);
$applicationTheme = $client->meetings()->createTheme('orange-room');
$applicationTheme = $client->meetings()->updateTheme($applicationTheme->theme_id, [
'update_details' => [
'brand_text' => 'Orange',
'main_color' => '#ff6500'
]
]);
client = vonage.Client(
application_id=VONAGE_APPLICATION_ID,
private_key=VONAGE_APPLICATION_PRIVATE_KEY_PATH,
)
response = client.meetings.create_theme(
{
'main_color': '#ff6500',
'brand_text': 'Orange',
'theme_name': 'orange-room',
}
)
Exemple de réponse
{
"theme_id": "49d900c8-372b-4c9e-b682-5601cbdc1f7a",
"theme_name": "orange-room",
"domain": "VCP",
"account_id": "123ab4cd",
"application_id": "921a6f5b-1f94-49f4-8107-26f0c75fc6e7",
"main_color": "#ff6500",
"short_company_url": null,
"brand_text": "Orange",
"brand_image_colored": null,
"brand_image_white": null,
"branded_favicon": null,
"brand_image_white_url": null,
"brand_image_colored_url": null,
"branded_favicon_url": null
}
Notez que les valeurs nulles représentent des images de thème qui peuvent être ajoutées à l'aide de l'option processus de gestion de l'image. Les URL qui seront générées une fois que ces images auront été téléchargées.
Mise à jour d'un thème
PATCH: https://api-eu.vonage.com/v1/meetings/themes/:theme_id
Les propriétés du thème qui peuvent être mises à jour sont les mêmes que celles qui peuvent être définies au moment de la mise à jour du thème. créer. Toutes les images doivent être ajoutées par l'intermédiaire de la fonction processus de gestion de l'image.
Pour mettre à jour les propriétés, vous aurez besoin de la fonction theme_id et un objet appelé update_details:
Exemple de demande
const credentials = new Auth({
privateKey: VONAGE_APPLICATION_PRIVATE_KEY_PATH,
applicationId: VONAGE_APPLICATION_ID,
});
const options = {};
const meetingsClient = new Meetings(credentials, options);
const theme = await meetingsClient.getTheme("86da462e-fac4-4f46-87ed-63eafc81be48");
theme.mainColor = '#12f64e';
theme.brand = 'Brand';
theme.shortCompanyUrl = "short-url";
await meetingsClient.updateTheme("86da462e-fac4-4f46-87ed-63eafc81be48", theme);
var client = VonageClient.builder()
.applicationId(VONAGE_APPLICATION_ID)
.privateKeyPath(VONAGE_PRIVATE_KEY_PATH)
.build();
var theme = client.getMeetingsClient().updateTheme(
UUID.fromString("86da462e-fac4-4f46-87ed-63eafc81be48"),
Theme.builder()
.mainColor("#12f64e")
.brandText("Brand")
.shortCompanyUrl("short-url")
.build()
);
var credentials = Credentials.FromAppIdAndPrivateKeyPath(applicationId, privateKeyPath);
var client = new VonageClient(credentials);
var request = UpdateThemeRequest.Build()
.WithThemeId(new Guid("86da462e-fac4-4f46-87ed-63eafc81be48"))
.WithColor(Color.FromArgb(255, 18, 246, 78))
.WithBrandText("Brand")
.WithShortCompanyUrl(new Uri("short-url", UriKind.Relative))
.Create();
var response = await client.MeetingsClient.UpdateThemeAsync(request);
$keypair = new Vonage\Client\Keypair(
VONAGE_APPLICATION_PRIVATE_KEY_PATH
VONAGE_APPLICATION_ID,
);
$client = new Vonage\Client($keypair);
$applicationTheme = $client->meetings()->updateTheme('49d900c8-372b-4c9e-b682-5601cbdc1f7a', [
'update_details' => [
'theme_name' => 'blue-theme',
'main_color' => '#0000ff'
'brand_text' => 'Blue'
'short_company_ul' => 'https://my-app/35f5D'
]
]);
client = vonage.Client(
application_id=VONAGE_APPLICATION_ID,
private_key=VONAGE_APPLICATION_PRIVATE_KEY_PATH,
)
response = client.meetings.update_theme(
'49d900c8-372b-4c9e-b682-5601cbdc1f7a',
{
'theme_name': 'blue-theme',
'main_color': '#0000ff',
'brand_text': 'Blue',
},
)
Exemple de réponse
{
"theme_id": "ef2b46f3-8ebb-437e-a671-272e4990fbc8",
"theme_name": "Theme1",
"domain": "VCP",
"account_id": "123ab4cd",
"application_id": "921a6f5b-1f94-49f4-8107-26f0c75fc6e7",
"main_color": "#12f64e",
"short_company_url": "short-url",
"brand_text": "Brand",
"brand_image_colored": "branded-image-colored",
"brand_image_white": "branded-image-white",
"branded_favicon": "branded-favicon",
"brand_image_colored_url": "branded-image-colored-url",
"brand_image_white_url": "branded-image-white-url",
"branded_favicon_url": "branded-favicon-url"
}
Obtenir un thème
https://api-eu.vonage.com/v1/meetings/themes/:theme_id
Envoyer une requête
Exemple de demande
const credentials = new Auth({
privateKey: VONAGE_APPLICATION_PRIVATE_KEY_PATH,
applicationId: VONAGE_APPLICATION_ID,
});
const options = {};
const meetingsClient = new Meetings(credentials, options);
const theme = await meetingsClient.getTheme("ef2b46f3-8ebb-437e-a671-272e4990fbc8");
var client = VonageClient.builder()
.applicationId(VONAGE_APPLICATION_ID)
.privateKeyPath(VONAGE_PRIVATE_KEY_PATH)
.build();
var theme = client.getMeetingsClient().getTheme(
UUID.fromString("ef2b46f3-8ebb-437e-a671-272e4990fbc8")
);
var credentials = Credentials.FromAppIdAndPrivateKeyPath(applicationId, privateKeyPath);
var client = new VonageClient(credentials);
var request = GetThemeRequest.Parse(new Guid("ef2b46f3-8ebb-437e-a671-272e4990fbc8"));
var response = await client.MeetingsClient.GetThemeAsync(request);
$keypair = new Vonage\Client\Keypair(
VONAGE_APPLICATION_PRIVATE_KEY_PATH
VONAGE_APPLICATION_ID,
);
$client = new Vonage\Client($keypair);
$theme = $client->meetings()->getThemeById('9f6fe8ae-3458-4a72-b532-8276d5533e97');
client = vonage.Client(
application_id=VONAGE_APPLICATION_ID,
private_key=VONAGE_APPLICATION_PRIVATE_KEY_PATH,
)
response = client.meetings.get_theme('ef2b46f3-8ebb-437e-a671-272e4990fbc8')
This will return a generic Vonage::Response object.
The Vonage::Response object de-serializes the returned JSON data into Vonage::Entity objects, and provides getter methods for the top level properties of that JSON data, for example:
Exemple de réponse
{
"theme_id": "ef2b46f3-8ebb-437e-a671-272e4990fbc8",
"theme_name": "Theme1",
"domain": "VCP",
"account_id": "123ab4cd",
"application_id": "921a6f5b-1f94-49f4-8107-26f0c75fc6e7",
"main_color": "#12f64e",
"short_company_url": "short-url",
"brand_text": "Brand",
"brand_image_colored": "branded-image-colored",
"brand_image_white": "branded-image-white",
"branded_favicon": "branded-favicon",
"brand_image_colored_url": "branded-image-colored-url",
"brand_image_white_url": "branded-image-white-url",
"branded_favicon_url": "branded-favicon-url"
}
Ajouter un thème à une pièce
Un thème peut être appliqué à un Chambre à long terme lors de la création ou de la mise à jour d'une pièce.
Création d'une salle
https://api-eu.vonage.com/v1/meetings/rooms
Cet exemple créer une salle de réunion à long terme avec le thème de l'orange :
const credentials = new Auth({
privateKey: VONAGE_APPLICATION_PRIVATE_KEY_PATH,
applicationId: VONAGE_APPLICATION_ID,
});
const options = {};
const meetingsClient = new Meetings(credentials, options);
await meetingsClient.createRoom({
type: MeetingType.LONG_TERM,
displayName: "New Meetings Room",
availableFeatures: {
isRecordingAvailable: true,
},
themeId: "e8b1d80b-8f78-4578-94f2-328596e01387",
});
var client = VonageClient.builder()
.applicationId(VONAGE_APPLICATION_ID)
.privateKeyPath(VONAGE_PRIVATE_KEY_PATH)
.build();
var room = MeetingRoom.builder("New Meeting Room")
.type(RoomType.LONG_TERM)
.expiresAt(EXPIRATION_DATE)
.themeId(UUID.fromString(
"e8b1d80b-8f78-4578-94f2-328596e01387"
))
.build();
client.getMeetingsClient().createRoom(room);
var credentials = Credentials.FromAppIdAndPrivateKeyPath(applicationId, privateKeyPath);
var client = new VonageClient(credentials);
var request = CreateRoomRequest.Build()
.WithDisplayName("New Meetings Room")
.AsLongTermRoom(expirationDate)
.WithThemeId("e8b1d80b-8f78-4578-94f2-328596e01387")
.Create();
var response = await client.MeetingsClient.CreateRoomAsync(request);
$keypair = new Vonage\Client\Keypair(
VONAGE_APPLICATION_PRIVATE_KEY_PATH
VONAGE_APPLICATION_ID,
);
$client = new Vonage\Client($keypair);
$room = (new Vonage\Meetings\Room())->fromArray([
'display_name' => 'New Meeting Room',
'type' => 'long_term',
'expires_at' => '2024-07-10 15:00:00.000',
'theme_id' => '49d900c8-372b-4c9e-b682-5601cbdc1f7a'
]);
$createdRoom = $client->meetings()->createRoom($room);
client = vonage.Client(
application_id=VONAGE_APPLICATION_ID,
private_key=VONAGE_APPLICATION_PRIVATE_KEY_PATH,
)
response = client.meetings.create_room({
'display_name': 'New Meeting Room',
'type': 'long_term',
'expires_at': '2024-07-10 15:00:00.000',
'theme_id': '49d900c8-372b-4c9e-b682-5601cbdc1f7a',
})
Mise à jour de la salle
PATCH: https://api-eu.vonage.com/v1/meetings/rooms/{ROOM_ID}
Pour mettre à jour le thème d'une pièce, vous aurez besoin de l'option theme_id et l'identifiant de la chambre :
const credentials = new Auth({
privateKey: VONAGE_APPLICATION_PRIVATE_KEY_PATH,
applicationId: VONAGE_APPLICATION_ID,
});
const options = {};
const meetingsClient = new Meetings(credentials, options);
const room = await meetingsClient.getRoom("9f6fe8ae-3458-4a72-b532-8276d5533e97");
room.themeId = "e8b1d80b-8f78-4578-94f2-328596e01387";
await meetingsClient.updateRoom("9f6fe8ae-3458-4a72-b532-8276d5533e97", room);
var client = VonageClient.builder()
.applicationId(VONAGE_APPLICATION_ID)
.privateKeyPath(VONAGE_PRIVATE_KEY_PATH)
.build();
var room = client.getMeetingsClient().updateRoom(
UUID.fromString("9f6fe8ae-3458-4a72-b532-8276d5533e97"),
UpdateRoomRequest.builder()
.themeId(UUID.fromString(
"e8b1d80b-8f78-4578-94f2-328596e01387"
))
.build()
);
var credentials = Credentials.FromAppIdAndPrivateKeyPath(applicationId, privateKeyPath);
var client = new VonageClient(credentials);
var request = UpdateRoomRequest.Build()
.WithRoomId(new Guid("9f6fe8ae-3458-4a72-b532-8276d5533e97"))
.WithThemeId("e8b1d80b-8f78-4578-94f2-328596e01387")
.Create();
var response = await client.MeetingsClient.UpdateRoomAsync(request);
$keypair = new Vonage\Client\Keypair(
VONAGE_APPLICATION_PRIVATE_KEY_PATH
VONAGE_APPLICATION_ID,
);
$client = new Vonage\Client($keypair);
$applicationTheme = $client->meetings()->updateRoom('9f6fe8ae-3458-4a72-b532-8276d5533e97' [
'update_details' => [
'theme_id' => 'e8b1d80b-8f78-4578-94f2-328596e01387',
]
]);
client = vonage.Client(
application_id=VONAGE_APPLICATION_ID,
private_key=VONAGE_APPLICATION_PRIVATE_KEY_PATH,
)
response = client.meetings.update_room(
'9f6fe8ae-3458-4a72-b532-8276d5533e97',
{'update_details': {'theme_id': 'e8b1d80b-8f78-4578-94f2-328596e01387'}},
)
Supprimer un thème d'une pièce
PATCH: https://api-eu.vonage.com/v1/meetings/rooms/{ROOM_ID}
Pour supprimer un thème d'une pièce, il faut mettre à jour la pièce à l'aide d'un fichier PATCH et l'identifiant de la salle. Mettez à jour le theme_id avec null pour supprimer le thème et utiliser le thème par défaut à la place.
Veuillez noter que seules les chambres à long terme peuvent être mises à jour.
Exemple de demande
const credentials = new Auth({
privateKey: VONAGE_APPLICATION_PRIVATE_KEY_PATH,
applicationId: VONAGE_APPLICATION_ID,
});
const options = {};
const meetingsClient = new Meetings(credentials, options);
await meetingsClient.updateRoom(ROOM_ID, "9f6fe8ae-3458-4a72-b532-8276d5533e97");
var client = VonageClient.builder()
.applicationId(VONAGE_APPLICATION_ID)
.privateKeyPath(VONAGE_PRIVATE_KEY_PATH)
.build();
var room = client.getMeetingsClient().updateRoom(
UUID.fromString("9f6fe8ae-3458-4a72-b532-8276d5533e97"),
UpdateRoomRequest.builder().themeId(null).build()
);
var credentials = Credentials.FromAppIdAndPrivateKeyPath(applicationId, privateKeyPath);
var client = new VonageClient(credentials);
var request = UpdateRoomRequest.Build()
.WithRoomId(new Guid("9f6fe8ae-3458-4a72-b532-8276d5533e97"))
.WithThemeId(null)
.Create();
var response = await client.MeetingsClient.UpdateRoomAsync(request);
$keypair = new Vonage\Client\Keypair(
VONAGE_APPLICATION_PRIVATE_KEY_PATH
VONAGE_APPLICATION_ID,
);
$client = new Vonage\Client($keypair);
$room = $client->meetings()->updateRoom(
'9f6fe8ae-3458-4a72-b532-8276d5533e97',
[
'update_details' => [
'theme_id' => ''
]
]
);
client = vonage.Client(
application_id=VONAGE_APPLICATION_ID,
private_key=VONAGE_APPLICATION_PRIVATE_KEY_PATH,
)
response = client.meetings.update_room(
'9f6fe8ae-3458-4a72-b532-8276d5533e97',
{'update_details': {'theme_id': None}}
)
Définir le thème par défaut
PATCH: https://api-eu.vonage.com/v1/meetings/applications
Un thème peut être défini comme thème par défaut pour l'application, ce qui signifie que chaque pièce créée utilisera automatiquement le thème par défaut. Pour ce faire, créez d'abord un thème, puis ajoutez-le en tant que thème par défaut de l'application. default_theme_id dans un objet appelé update_details.
Exemple de demande
const credentials = new Auth({
privateKey: VONAGE_APPLICATION_PRIVATE_KEY_PATH,
applicationId: VONAGE_APPLICATION_ID,
});
const options = {};
const meetingsClient = new Meetings(credentials, options);
await meetingsClient.setDefaultTheme("e8b1d80b-8f78-4578-94f2-328596e01387");
var client = VonageClient.builder()
.applicationId(VONAGE_APPLICATION_ID)
.privateKeyPath(VONAGE_PRIVATE_KEY_PATH)
.build();
var application = client.getMeetingsClient().updateApplication(
UpdateApplicationRequest.builder()
.defaultThemeId(UUID.fromString(
"e8b1d80b-8f78-4578-94f2-328596e01387"
))
.build()
);
var credentials = Credentials.FromAppIdAndPrivateKeyPath(applicationId, privateKeyPath);
var client = new VonageClient(credentials);
var request = UpdateApplicationRequest.Parse(new Guid("e8b1d80b-8f78-4578-94f2-328596e01387"));
var response = await client.MeetingsClient.UpdateApplicationAsync(request);
$keypair = new Vonage\Client\Keypair(
VONAGE_APPLICATION_PRIVATE_KEY_PATH
VONAGE_APPLICATION_ID,
);
$client = new Vonage\Client($keypair);
$updatedApplication = $client->meetings()->updateApplication([
'update_details' => [
'default_theme_id' => 'e8b1d80b-8f78-4578-94f2-328596e01387'
]
]);
client = vonage.Client(
application_id=VONAGE_APPLICATION_ID,
private_key=VONAGE_APPLICATION_PRIVATE_KEY_PATH,
)
response = client.meetings.update_application_theme('e8b1d80b-8f78-4578-94f2-328596e01387')
Exemple de réponse
{
"application_id":"3db604ce-b4c0-48f4-8b82-4a03ac9f6bk7",
"account_id":"69b2a6d2",
"default_theme_id":"e8b1d80b-8f78-4578-94f2-328596e01387"
}
Supprimer un thème
[EFFACER] : https://api-eu.vonage.com/v1/meetings/themes/{THEME_ID}
Pour supprimer un thème, envoyez une demande DELETE en utilisant l'identifiant du thème. Veuillez noter qu'un thème qui est défini par défaut ou qui est actuellement utilisé par une salle ne peut pas être supprimé et qu'une erreur sera renvoyée.
Pour supprimer un thème en cours d'utilisation, vous devez le supprimer de chaque pièce qui l'utilise en procédant comme suit recherche de toutes les pièces utilisant ce thème et de supprimer le thème.
Par ailleurs, si vous souhaitez remplacer et supprimer le thème sans le supprimer manuellement, ajoutez un paramètre de requête de type force=true. Le thème par défaut sera désormais appliqué à toutes les pièces qui utilisaient ce thème.
const credentials = new Auth({
privateKey: VONAGE_APPLICATION_PRIVATE_KEY_PATH,
applicationId: VONAGE_APPLICATION_ID,
});
const options = {};
const meetingsClient = new Meetings(credentials, options);
await meetingsClient.deleteTheme("e8b1d80b-8f78-4578-94f2-328596e01387", true);
var client = VonageClient.builder()
.applicationId(VONAGE_APPLICATION_ID)
.privateKeyPath(VONAGE_PRIVATE_KEY_PATH)
.build();
var themeId = UUID.fromString("e8b1d80b-8f78-4578-94f2-328596e01387");
client.getMeetingsClient().deleteTheme(themeId, true);
var credentials = Credentials.FromAppIdAndPrivateKeyPath(applicationId, privateKeyPath);
var client = new VonageClient(credentials);
var request = DeleteThemeRequest.Build()
.WithThemeId(new Guid("e8b1d80b-8f78-4578-94f2-328596e01387"))
.WithForceDelete()
.Create();
var response = await client.MeetingsClient.DeleteThemeAsync(request);
$keypair = new Vonage\Client\Keypair(
VONAGE_APPLICATION_PRIVATE_KEY_PATH
VONAGE_APPLICATION_ID,
);
$client = new Vonage\Client($keypair);
$client->meetings()->deleteTheme('9f6fe8ae-3458-4a72-b532-8276d5533e97', true);
client = vonage.Client(
application_id=VONAGE_APPLICATION_ID,
private_key=VONAGE_APPLICATION_PRIVATE_KEY_PATH,
)
client.meetings.delete_theme('e8b1d80b-8f78-4578-94f2-328596e01387', force=True)
Obtenir toutes les pièces avec un thème donné
https://api-eu.vonage.com/v1/meetings/themes/{THEME_ID}/rooms
Pour obtenir la liste des salles utilisant un thème particulier, envoyez une requête
theme_id: Exemple de demande
const credentials = new Auth({
privateKey: VONAGE_APPLICATION_PRIVATE_KEY_PATH,
applicationId: VONAGE_APPLICATION_ID,
});
const options = {};
const meetingsClient = new Meetings(credentials, options);
const rooms = meetingsClient.getRoomsForTheme("e8b1d80b-8f78-4578-94f2-328596e01387");
var client = VonageClient.builder()
.applicationId(VONAGE_APPLICATION_ID)
.privateKeyPath(VONAGE_PRIVATE_KEY_PATH)
.build();
var rooms = client.getMeetingsClient().searchRoomsByTheme(
UUID.fromString("e8b1d80b-8f78-4578-94f2-328596e01387")
);
var client = new VonageClient(credentials);
var request = GetRoomsByThemeRequest.Build()
.WithThemeId(new Guid("e8b1d80b-8f78-4578-94f2-328596e01387"))
.Create();
var response = await client.MeetingsClient.GetRoomsByThemeAsync(request);
$keypair = new Vonage\Client\Keypair(
VONAGE_APPLICATION_PRIVATE_KEY_PATH
VONAGE_APPLICATION_ID,
);
$client = new Vonage\Client($keypair);
$rooms = $client->meetings()->getRoomsByThemeID('e8b1d80b-8f78-4578-94f2-328596e01387');
client = vonage.Client(
application_id=VONAGE_APPLICATION_ID,
private_key=VONAGE_APPLICATION_PRIVATE_KEY_PATH,
)
response = client.meetings.list_rooms_with_theme_id('e8b1d80b-8f78-4578-94f2-328596e01387')
This will return an object of the Vonage::Meetings::Rooms::ListResponse class.
This class defines an each method, allowing you to iterate through the _embedded array returned in ther response. For example:
The class also includes Enumerable, so you can call any instance method from that module on the object. For example:
Cela renvoie une liste de toutes les pièces utilisant ce thème.