List rooms by theme
This code snippet shows how to list all rooms associated with a theme using the Meetings API.
See the API Reference for more information.
Example Request
Where needed, replace the following variables in the sample code with your own values:
| Key | Description |
|---|---|
JWT | Used to authenticate your request. See Authentication for more information, including how to generate a JWT. |
THEME_ID | The theme UUID. |
VONAGE_APPLICATION_ID | The Vonage Application ID. |
VONAGE_APPLICATION_PRIVATE_KEY_PATH | Private key path. |
Write the code
Add the following to list-rooms-by-theme.sh:
curl -X GET "https://api-eu.vonage.com/meetings/themes/"$THEME_ID"/rooms" \
-H "Authorization: Bearer $JWT"Run your code
Save this file to your machine and run it:
Prerequisites
npm install @vonage/server-sdkCreate a file named request.js and add the following code:
const { Auth } = require('@vonage/auth');
const { Meetings } = require('@vonage/meetings');
const credentials = new Auth({
privateKey: VONAGE_APPLICATION_PRIVATE_KEY_PATH,
applicationId: VONAGE_APPLICATION_ID,
});
const meetingsClient = new Meetings(credentials);Write the code
Add the following to request.js:
const run = async () => {
try {
for (const room of meetingsClient.getRoomsForTheme(THEME_ID)) {
console.log(room);
}
} catch (error) {
console.error(error);
}
};
run();Run your code
Save this file to your machine and run it:
Prerequisites
pip install vonageCreate a file named request.py and add the following code:
Run your code
Save this file to your machine and run it:
Prerequisites
gem install vonageCreate a file named list-rooms-by-theme.rb and add the following code:
client = Vonage::Client.new(
application_id: VONAGE_APPLICATION_ID,
private_key: File.read(VONAGE_APPLICATION_PRIVATE_KEY_PATH)
)Write the code
Add the following to list-rooms-by-theme.rb:
rooms = client.meetings.themes.list_rooms(theme_id: THEME_ID)Run your code
Save this file to your machine and run it: