Official Documentation
const params = {
limit : 25 ,
page : 1 ,
filter : {
name : "dummy" ,
} ,
sort : "-name"
} ;
mailerlite . groups . get ( params )
. then ( response => {
console . log ( response . data ) ;
} )
. catch ( error => {
if ( error . response ) console . log ( error . response . data ) ;
} ) ;
Official Documentation
const params = {
name : "Dummy group"
} ;
mailerlite . groups . create ( "GROUP_ID" , params )
. then ( response => {
console . log ( response . data ) ;
} )
. catch ( error => {
if ( error . response ) console . log ( error . response . data ) ;
} ) ;
Official Documentation
const params = {
name : "Dummy group updated"
}
mailerlite . groups . update ( "GROUP_ID" , params )
. then ( response => {
console . log ( response . data ) ;
} )
. catch ( error => {
if ( error . response ) console . log ( error . response . data ) ;
} ) ;
Official Documentation
mailerlite . groups . delete ( "GROUP_ID" )
. then ( response => {
console . log ( response . data ) ;
} )
. catch ( error => {
if ( error . response ) console . log ( error . response . data ) ;
} ) ;
Get subscribers belonging to a group
Official Documentation
const params = {
filter : {
status : "active" // active, unsubscribed, unconfirmed, bounced or junk
} ,
limit : 5 ,
page : 1
} ;
mailerlite . groups . getSubscribers ( "GROUP_ID" , params )
. then ( response => {
console . log ( response . data ) ;
} )
. catch ( error => {
if ( error . response ) console . log ( error . response . data ) ;
} ) ;
Assign subscriber to a group
Official Documentation
mailerlite . groups . assignSubscriber ( "SUBSCRIBER_ID" , "GROUP_ID" )
. then ( response => {
console . log ( response . data ) ;
} )
. catch ( error => {
if ( error . response ) console . log ( error . response . data ) ;
} ) ;
Unassign subscriber from a group
Official Documentation
mailerlite . groups . unAssignSubscriber ( "SUBSCRIBER_ID" , "GROUP_ID" )
. then ( response => {
console . log ( response . data ) ;
} )
. catch ( error => {
if ( error . response ) console . log ( error . response . data ) ;
} ) ;