SceneAudio

Plattar API sceneaudio Reference

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

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

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

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

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

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

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