Official Documentation
const params = {
limit: 5,
page: 1,
filter: {
type: "text", // text, number, date
},
sort: "name" // name, -name, type, -type
}
mailerlite.fields.get(params)
.then(response => {
console.log(response.data);
})
.catch(error => {
if (error.response) console.log(error.response.data);
});
Official Documentation
const params = {
name: 'Test field',
type: 'text' // text, number, date
}
mailerlite.fields.create(params)
.then(response => {
console.log(response.data);
})
.catch(error => {
if (error.response) console.log(error.response.data);
});
Official Documentation
const params = {
name: "Updated field name"
};
mailerlite.fields.update("FIELD_ID", params)
.then(response => {
console.log(response.data);
})
.catch(error => {
if (error.response) console.log(error.response.data);
});
Official Documentation
mailerlite.fields.delete("FIELD_ID")
.then(response => {
console.log(response.data);
})
.catch(error => {
if (error.response) console.log(error.response.data);
});