SceneYoutube

Plattar API sceneyoutube Reference

Parent
Relationships
Imports
NodeJS Imports
const {
  	Scene,
  	SceneYoutube,
  	Server
} = require('@plattar/plattar-api');
Initialisation
Initialise the SceneYoutube Object
const youtube = new SceneYoutube('your-scene-youtube-id');
.get()
Populate the object with data
youtube.get().then((youtube) => {
	// do something with youtube
}).catch((error) => {
	// do something with error
});
.update()
Update the object with new data
Server.default().auth(process.env.PLATTAR_AUTH_TOKEN);

youtube.attributes.title = 'your-new-scene-youtube-title';

youtube.update().then((youtube) => {
	// do something with youtube
}).catch((error) => {
	// do something with error
});
.create()
Create a new object
Server.default().auth(process.env.PLATTAR_AUTH_TOKEN);

youtube.attributes.title = 'your-new-scene-youtube-title';

// you must pass the parent object during create function
const parent = new Scene('your-scene-id');

youtube.create(parent).then((youtube) => {
	// do something with youtube
}).catch((error) => {
	// do something with error
});
.delete()
Delete a previous object
Server.default().auth(process.env.PLATTAR_AUTH_TOKEN);

youtube.delete().then((youtube) => {
	// do something with youtube
}).catch((error) => {
	// do something with error
});