Gestión de salas de reuniones
Esta guía le mostrará cómo:
- Recuperar los detalles de una habitación individual.
- Obtenga una lista de todas las salas asociadas a su solicitud.
- Cambiar la fecha de caducidad de una habitación individual de larga duración.
Recuperación de salas individuales
https://api-eu.vonage.com/v1/meetings/rooms/:room_id
Cuando crees una sala, obtendrás una sala id en la respuesta. Este id puede utilizarse para recuperar salas mediante una solicitud
Ejemplo de solicitud
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");
var client = VonageClient.builder()
.applicationId(VONAGE_APPLICATION_ID)
.privateKeyPath(VONAGE_PRIVATE_KEY_PATH)
.build();
var room = client.getMeetingsClient().getRoom(
UUID.fromString("9f6fe8ae-3458-4a72-b532-8276d5533e97")
);
var credentials = Credentials.FromAppIdAndPrivateKeyPath(applicationId, privateKeyPath);
var client = new VonageClient(credentials);
var request = GetRoomRequest.Parse(new Guid("9f6fe8ae-3458-4a72-b532-8276d5533e97"));
var response = await client.MeetingsClient.GetRoomAsync(request);
$keypair = new Vonage\Client\Keypair(
VONAGE_APPLICATION_PRIVATE_KEY_PATH
VONAGE_APPLICATION_ID,
);
$client = new Vonage\Client($keypair);
$recording = $client->meetings()->getRoom('9f6fe8ae-3458-4a72-b532-8276d5533e97');
client = vonage.Client(
application_id=VONAGE_APPLICATION_ID,
private_key=VONAGE_APPLICATION_PRIVATE_KEY_PATH,
)
response = client.meetings.get_room('9f6fe8ae-3458-4a72-b532-8276d5533e97')
Esto devolverá un Vonage::Response objeto.
En Vonage::Response de-serializa los datos JSON devueltos en Vonage::Entity y proporciona métodos getter para las propiedades de nivel superior de esos datos JSON, por ejemplo:
Para las propiedades de los datos JSON cuyo valor es un objeto JSON, éste se de-serializa a su vez en un objeto Vonage::Entity con sus propios métodos getter. Por ejemplo, el objeto recording_options devuelve un Vonage::Entity objeto con auto_record y record_only_owner getters. Puedes encadenar estas invocaciones a métodos getter para llegar a los datos que necesitas:
La respuesta será idéntica tanto si la habitación es de larga duración como si es instantánea.
Ejemplo de respuesta
{
"id": "9f6fe8ae-3458-4a72-b532-8276d5533e97",
"display_name": "My custom room",
"metadata": "Welcome to my custom room",
"type": "instant",
"recording_options": {
"auto_record": false,
"record_only_owner": false
},
"meeting_code": "280674154",
"is_available": true,
"theme_id": "ef2b46f3-8ebb-437e-a671-272e4990fbc8",
"created_at": "2023-06-06T06:45:07.135Z",
"expires_at": "2023-06-06T06:55:07.134Z",
"expire_after_use": true,
"join_approval_level": "none",
"initial_join_options": {
"microphone_state": "on"
},
"callback_urls": {
"rooms_callback_url": "https://example.com/rooms",
"sessions_callback_url": "https://example.com/sessions",
"recordings_callback_url": "https://example.com/recordings"
},
"available_features": {
"is_recording_available": true,
"is_chat_available": true,
"is_whiteboard_available": true,
"is_locale_switcher_available": true,
"is_captions_available": false
},
"ui_settings": {
"language": "es"
},
"_links": {
"guest_url": {
"href": "https://meetings.vonage.com/280674154"
},
"host_url": {
"href": "https://meetings.vonage.com/?room_token=280674154&participant_token=eyJhbGciOiJIUzI1NiIsInR5cC"
}
}
}
Recuperar todas las salas
https://api-eu.vonage.com/v1/meetings/rooms/
Para recuperar todas las salas, envíe una solicitud
id: Ejemplo de solicitud
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.getRooms();
var client = VonageClient.builder()
.applicationId(VONAGE_APPLICATION_ID)
.privateKeyPath(VONAGE_PRIVATE_KEY_PATH)
.build();
var rooms = client.getMeetingsClient().listRooms();
var credentials = Credentials.FromAppIdAndPrivateKeyPath(applicationId, privateKeyPath);
var client = new VonageClient(credentials);
var request = GetRoomsRequest.Build().Create();
var response = await client.MeetingsClient.GetRoomsAsync(request);
$keypair = new Vonage\Client\Keypair(
VONAGE_APPLICATION_PRIVATE_KEY_PATH
VONAGE_APPLICATION_ID,
);
$client = new Vonage\Client($keypair);
$recordings = $client->meetings()->getAllListedRooms();
client = vonage.Client(
application_id=VONAGE_APPLICATION_ID,
private_key=VONAGE_APPLICATION_PRIVATE_KEY_PATH,
)
response = client.meetings.list_rooms()
Esto devolverá un objeto del tipo Vonage::Meetings::Rooms::ListResponse clase.
Esta clase define un each que le permite iterar a través del método _embedded devuelto en la respuesta. Por ejemplo:
La clase también incluye Enumerablepor lo que puede llamar a cualquier método de instancia de ese módulo en el objeto. Por ejemplo:
Ejemplo de respuesta
{
"page_size": 25,
"total_items": 30,
"_embedded": [
{
"id": "9f6fe8ae-3458-4a72-b532-8276d5533e97",
"display_name": "My custom room",
"metadata": "Welcome to my custom room",
"type": "instant",
"recording_options": {
"auto_record": false,
"record_only_owner": false
},
"meeting_code": "280674154",
"is_available": true,
"theme_id": "ef2b46f3-8ebb-437e-a671-272e4990fbc8",
"created_at": "2023-06-06T06:45:07.135Z",
"expires_at": "2023-06-06T06:55:07.134Z",
"expire_after_use": true,
"join_approval_level": "none",
"initial_join_options": {
"microphone_state": "on"
},
"callback_urls": {
"rooms_callback_url": "https://example.com/rooms",
"sessions_callback_url": "https://example.com/sessions",
"recordings_callback_url": "https://example.com/recordings"
},
"available_features": {
"is_recording_available": true,
"is_chat_available": true,
"is_whiteboard_available": true,
"is_locale_switcher_available": true,
"is_captions_available": false
},
"ui_settings": {
"language": "es"
},
"_links": {
"guest_url": {
"href": "https://meetings.vonage.com/280674154"
},
"host_url": {
"href": "https://meetings.vonage.com/?room_token=280674154&participant_token=eyJhbGciOiJIUzI1NiIsInR5cC"
}
}
}
],
"_links": {
"first": {
"href": "https://api-eu.vonage.com/v1/meetings/rooms?page_size=50"
},
"self": {
"href": "https://api-eu.vonage.com/v1/meetings/rooms?page_size=50&start_id=2293905"
},
"next": {
"href": "https://api-eu.vonage.com/v1/meetings/rooms?page_size=50&start_id=2293906"
},
"prev": {
"href": "https://api-eu.vonage.com/v1/meetings/rooms?page_size=50&start_id=2293904"
}
}
}
Actualización de la caducidad
PATCH: https://api-eu.vonage.com/v1/meetings/rooms/
La fecha de caducidad de una sala de larga duración puede actualizarse mediante una función PATCH la acción y la sala id. La nueva fecha debe incluirse en un objeto llamado update_details:
Ejemplo de solicitud
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.expiresAt = '2022-11-11T16:00:00.000Z';
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()
.expiresAt(Instant.parse("2022-11-11T16:00:00.000Z"))
.build()
);
var credentials = Credentials.FromAppIdAndPrivateKeyPath(applicationId, privateKeyPath);
var client = new VonageClient(credentials);
var request = UpdateRoomRequest.Build()
.WithRoomId(new Guid("9f6fe8ae-3458-4a72-b532-8276d5533e97"))
.WithExpiresAt(DateTime.Parse("2022-11-11T16:00:00.000Z"))
.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' => [
'expires_at' => '2023-11-11T16:00:00.000Z',
]
]);
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': {'expires_at': '2023-11-11T16:00:00.000Z'}},
)
Tenga en cuenta que sólo se pueden actualizar las habitaciones de larga estancia.