Official Documentation
const params = {
limit : 25 ,
page : 1
} ;
mailerlite . segments . get ( params )
. then ( response => {
console . log ( response . data ) ;
} )
. catch ( error => {
if ( error . response ) console . log ( error . response . data ) ;
} ) ;
Get subscribers belonging to a segment
Official Documentation
const params = {
filter : {
status : "active" ,
} ,
limit : 5 ,
after : "SUBSCRIBER_ID"
}
mailerlite . segments . getSubscribers ( "SEGMENT_ID" , params )
. then ( response => {
console . log ( response . data ) ;
} )
. catch ( error => {
if ( error . response ) console . log ( error . response . data ) ;
} ) ;
Official Documentation
const params = {
name : "Updated segment name"
} ;
mailerlite . segments . update ( "SEGMENT_ID" , params )
. then ( response => {
console . log ( response . data ) ;
} )
. catch ( error => {
if ( error . response ) console . log ( error . response . data ) ;
} ) ;
Official Documentation
mailerlite . segments . delete ( "SEGMENT_ID" )
. then ( response => {
console . log ( response . data ) ;
} )
. catch ( error => {
if ( error . response ) console . log ( error . response . data ) ;
} ) ;