Create a Theme
This code snippet shows how to create 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. |
MAIN_COLOR | The main color that will be used for the meeting room. |
BRAND_TEXT | The text that will appear on the meeting homepage, in the case that there is no brand image. |
VONAGE_APPLICATION_ID | The Vonage Application ID. |
VONAGE_APPLICATION_PRIVATE_KEY_PATH | Private key path. |
Write the code
Add the following to create-theme.sh:
curl -X POST https://api-eu.vonage.com/meetings/themes \
-H "Authorization: Bearer $JWT" \
-H "Content-Type: application/json" \
-d '{
"main_color": "'$MAIN_COLOR'",
"brand_text": "'$BRAND_TEXT'"
}'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:
meetingsClient.createTheme({
themeName: THEME_DISPLAY_NAME,
mainColor: '#c0ffee',
})
.then((theme) => console.log(theme))
.catch((error) => console.error(error));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:
import vonage
client = vonage.Client(
application_id=VONAGE_APPLICATION_ID,
private_key=VONAGE_PRIVATE_KEY,Write the code
Add the following to request.py:
response = client.meetings.create_theme(
{
'main_color': MAIN_COLOR,
'brand_text': BRAND_TEXT,
}Run your code
Save this file to your machine and run it:
Prerequisites
gem install vonageCreate a file named create-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 create-theme.rb:
theme = client.meetings.themes.create(
main_color: MAIN_COLOR,
brand_text: BRAND_TEXT
)Run your code
Save this file to your machine and run it:
Example Response
Your theme has been created.
{
"theme_id": "d2ea5d08-43fa-4aeb-9855-dd87d72cb49f",
"theme_name": "My custom theme",
"domain": "VCP",
"account_id": "123ab1ab",
"application_id": "e3ad0a31-5043-49c7-9c7c-db42ec77823b",
"main_color": "#12f64e",
"short_company_url": null,
"brand_text": "My custom brand",
"brand_image_colored": null,
"brand_image_white": null,
"branded_favicon": null,
"white_label": false,
"brand_image_white_url": null,
"brand_image_colored_url": null,
"branded_favicon_url": null
}