CardButton

Plattar API cardbutton Reference

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

button.attributes.title = 'your-new-card-button-title';

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

button.attributes.title = 'your-new-card-button-title';

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

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

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