Temas de la lista
Este fragmento de código muestra cómo enumerar los temas disponibles utilizando la Meetings API.
Véase el Referencia API para más información.
Ejemplo de solicitud
Cuando sea necesario, sustituya las siguientes variables del código de ejemplo por sus propios valores:
| Clave | Descripción |
|---|---|
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. |
Escriba el código
Añada lo siguiente a list-themes.sh:
curl -X GET https://api-eu.vonage.com/meetings/themes \
-H "Authorization: Bearer $JWT"Ejecute su código
Guarde este archivo en su máquina y ejecútelo:
Requisitos previos
npm install @vonage/server-sdkCrea un archivo llamado request.js y añade el siguiente código:
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);Escriba el código
Añada lo siguiente a request.js:
const run = async () => {
try {
for await (const theme of meetingsClient.getThemes()) {
console.log(theme);
}
} catch (error) {
console.error(error);
}
};
run();Ejecute su código
Guarde este archivo en su máquina y ejecútelo:
Requisitos previos
pip install vonageCrea un archivo llamado request.py y añade el siguiente código:
import vonage
client = vonage.Client(
application_id=VONAGE_APPLICATION_ID,
private_key=VONAGE_PRIVATE_KEY,Ejecute su código
Guarde este archivo en su máquina y ejecútelo:
Requisitos previos
gem install vonageCrea un archivo llamado list-themes.rb y añade el siguiente código:
client = Vonage::Client.new(
application_id: VONAGE_APPLICATION_ID,
private_key: File.read(VONAGE_APPLICATION_PRIVATE_KEY_PATH)
)Escriba el código
Añada lo siguiente a list-themes.rb:
themes = client.meetings.themes.listEjecute su código
Guarde este archivo en su máquina y ejecútelo:
Ejemplo de respuesta
[
{
"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"
}
]