Delete a theme
This code snippet shows how to delete a theme using the Meetings API.
See the API Reference for more information.
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. |
VONAGE_APPLICATION_ID | The Vonage Application ID. |
VONAGE_APPLICATION_PRIVATE_KEY_PATH | Private key path. |
THEME_ID | The theme UUID. |
Write the code
Add the following to delete-theme.sh:
curl -X DELETE "https://api-eu.vonage.com/meetings/themes/"$THEME_ID \
-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:
meetingsClient.deleteTheme(THEME_ID)
.then(() => console.log('Theme deleted'))
.catch((error) => console.error(error));
Run your code
Save this file to your machine and run it:
Prerequisites
Add the following to build.gradle:
implementation 'com.vonage:server-sdk:8.15.1'Create a file named DeleteTheme and add the following code to the main method:
VonageClient client = VonageClient.builder()
.applicationId(VONAGE_APPLICATION_ID)
.privateKeyPath(VONAGE_PRIVATE_KEY_PATH)
.build();Write the code
Add the following to the main method of the DeleteTheme file:
client.getMeetingsClient().deleteTheme(THEME_ID, true);Run your code
We can use the application plugin for Gradle to simplify the running of our application. Update your build.gradle with the following:
apply plugin: 'application'
mainClassName = project.hasProperty('main') ? project.getProperty('main') : ''Run the following gradle command to execute your application, replacing com.vonage.quickstart.meetings with the package containing DeleteTheme:
Prerequisites
Install-Package VonageCreate a file named DeleteTheme.cs and add the following code:
using Vonage;
using Vonage.Meetings.DeleteTheme;
using Vonage.Request;Add the following to DeleteTheme.cs:
var credentials = Credentials.FromAppIdAndPrivateKeyPath(applicationId, privateKeyPath);
var client = new VonageClient(credentials);Write the code
Add the following to DeleteTheme.cs:
var request = DeleteThemeRequest.Build()
.WithThemeId(themeId)
.Create();
var response = await client.MeetingsClient.DeleteThemeAsync(request);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_APPLICATION_PRIVATE_KEY_PATH,
)Write the code
Add the following to request.py:
client.meetings.delete_theme(THEME_ID)Run your code
Save this file to your machine and run it:
Prerequisites
gem install vonageCreate a file named delete-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 delete-theme.rb:
client.meetings.themes.delete(theme_id: THEME_ID)Run your code
Save this file to your machine and run it: