Page

Plattar API page Reference

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

page.attributes.title = 'your-new-page-title';

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

page.attributes.title = 'your-new-page-title';

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

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

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