SceneAnnotation

Plattar API sceneannotation Reference

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

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

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

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

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

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

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