SceneImage

Plattar API sceneimage Reference

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

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

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

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

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

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

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