You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
'use strict';constmoment=require('moment');constlib=require('lib');constconfiguration=lib.Configuration;constcontroller=lib.EventsController;configuration.apiKey='your api_key here';letstartdate=moment('2016-03-13','YYYY-MM-DD');letevents=lib.EventsEnum.BOUNCE;letsort=lib.SortEnum.DESC;letenddate=moment('2020-05-26','YYYY-MM-DD');letsubject='test';letemail='[email protected]';constpromise=controller.getEventsGET(startdate,events,sort,enddate,null,null,subject,null,null,email);promise.then((response)=>{// this block will be executed on successful endpoint call// `response` will be of type 'object'},(err)=>{// this block will be executed on endpoint call failure// `err` is an 'object' containing more information about the error});
fetch summary stats
'use strict';constmoment=require('moment');constlib=require('lib');constconfiguration=lib.Configuration;constcontroller=lib.StatsController;configuration.apiKey='your api_key here';letstartdate=moment('2016-03-13','YYYY-MM-DD');letenddate=moment('2020-05-26','YYYY-MM-DD');letaggregatedBy=lib.AggregatedByEnum.MONTH;constpromise=controller.getStatsGET(startdate,enddate,aggregatedBy);promise.then((response)=>{// this block will be executed on successful endpoint call// `response` will be of type 'object'},(err)=>{// this block will be executed on endpoint call failure// `err` is an 'object' containing more information about the error});
Domain Add
'use strict';constlib=require('lib');constconfiguration=lib.Configuration;constcontroller=lib.DomainController;configuration.apiKey='your api_key here';letbody=newlib.DomainStruct();body.domain='example.com';body.envelopeName='test';constpromise=controller.addDomain(body);promise.then((response)=>{// this block will be executed on successful endpoint call// `response` will be of type 'object'},(err)=>{// this block will be executed on endpoint call failure// `err` is an 'object' containing more information about the error});
Domain delete
'use strict';constlib=require('lib');constconfiguration=lib.Configuration;constcontroller=lib.DomainDeleteController;configuration.apiKey='your api_key here';letbody=newlib.DeleteDomain();body.domain='example.com';constpromise=controller.deleteDomain(body);promise.then((response)=>{// this block will be executed on successful endpoint call// `response` will be of type 'object'},(err)=>{// this block will be executed on endpoint call failure// `err` is an 'object' containing more information about the error});
Suppression add
'use strict';constlib=require('lib');constconfiguration=lib.Configuration;constcontroller=lib.SuppressionController;configuration.apiKey='your api_key here';letbody=newlib.AddEmailOrDomainToSuppressionList();body.domain='example.com';body.email='[email protected]';constpromise=controller.addDomainOrEmailToSuppressionList(body);promise.then((response)=>{// this block will be executed on successful endpoint call// `response` will be of type 'object'},(err)=>{// this block will be executed on endpoint call failure// `err` is an 'object' containing more information about the error});
Suppression delete
'use strict';constlib=require('lib');constconfiguration=lib.Configuration;constcontroller=lib.SuppressionController;configuration.apiKey='your api_key here';letbody=newlib.RemoveEmailOrDomainToSuppressionList();body.domain='example.com';body.email='[email protected]';constpromise=controller.removeDomainOrEmailToSuppressionList(body);promise.then((response)=>{// this block will be executed on successful endpoint call// `response` will be of type 'object'},(err)=>{// this block will be executed on endpoint call failure// `err` is an 'object' containing more information about the error});
create subaccount
'use strict';constlib=require('lib');constconfiguration=lib.Configuration;constcontroller=lib.SubaccountsCreateSubaccountController;configuration.apiKey='your api_key here';letbody=newlib.CreateSubaccount();body.username='name';body.email='email1.gmail.com';body.setpassword='setpassword8';body.password='pwd';constpromise=controller.createSubaccountsCreateSubaccountPOST(body);promise.then((response)=>{// this block will be executed on successful endpoint call// `response` will be of type 'object'},(err)=>{// this block will be executed on endpoint call failure// `err` is an 'object' containing more information about the error});
update subaccount
'use strict';constlib=require('lib');constconfiguration=lib.Configuration;constcontroller=lib.SubaccountsUpdateSubaccountController;configuration.apiKey='your api_key here';letbody=newlib.UpdateSubaccount();body.username='username';body.newEmail='[email protected]';body.newPassword='[email protected]';body.confirmPassword='pwd';constpromise=controller.createSubaccountsUpdateSubaccountPOST(body);promise.then((response)=>{// this block will be executed on successful endpoint call// `response` will be of type 'object'},(err)=>{// this block will be executed on endpoint call failure// `err` is an 'object' containing more information about the error});
enable/disable subaccount
'use strict';constlib=require('lib');constconfiguration=lib.Configuration;constcontroller=lib.SubaccountsController;configuration.apiKey='your api_key here';letbody=newlib.EnableOrDisableSubacoount();body.username='username';body.disabled=true;constpromise=controller.updateSubaccountsPATCH(body);promise.then((response)=>{// this block will be executed on successful endpoint call// `response` will be of type 'object'},(err)=>{// this block will be executed on endpoint call failure// `err` is an 'object' containing more information about the error});
delete subaccount
'use strict';constlib=require('lib');constconfiguration=lib.Configuration;constcontroller=lib.SubaccountsDeleteController;configuration.apiKey='your api_key here';letbody=newlib.DeleteSubacoount();body.username='username';constpromise=controller.deleteSubaccountsDeleteDELETE(body);promise.then((response)=>{// this block will be executed on successful endpoint call// `response` will be of type 'object'},(err)=>{// this block will be executed on endpoint call failure// `err` is an 'object' containing more information about the error});
set recurring credit in subaccount
'use strict';constlib=require('lib');constconfiguration=lib.Configuration;constcontroller=lib.SetrecurringcreditddetailsController;configuration.apiKey='your api_key here';letbody=newlib.UpdateRecurringCredisOfSubaccount();body.username='username';body.recurringCredit=100;body.timeperiod=lib.TimeperiodEnum.WEEKLY;constpromise=controller.createSetrecurringcreditddetailsPOST(body);promise.then((response)=>{// this block will be executed on successful endpoint call// `response` will be of type 'object'},(err)=>{// this block will be executed on endpoint call failure// `err` is an 'object' containing more information about the error});
add credit in subaccount
'use strict';constlib=require('lib');constconfiguration=lib.Configuration;constcontroller=lib.SubaccountsSetsubaccountcreditController;configuration.apiKey='your api_key here';letbody=newlib.UpdateCredisOfSubaccount();body.username='username';body.action=lib.ActionEnum.INCREASE;body.amount=100;constpromise=controller.createSubaccountsSetsubaccountcreditPOST(body);promise.then((response)=>{// this block will be executed on successful endpoint call// `response` will be of type 'object'},(err)=>{// this block will be executed on endpoint call failure// `err` is an 'object' containing more information about the error});
get credit details of subaccount
'use strict';constlib=require('lib');constconfiguration=lib.Configuration;constcontroller=lib.SubaccountsGetSubAccountsController;configuration.apiKey='your api_key here';letlimit='100';letoffset='1';constpromise=controller.getSubaccountsGetSubAccountsGET(limit,offset);promise.then((response)=>{// this block will be executed on successful endpoint call// `response` will be of type 'object'},(err)=>{// this block will be executed on endpoint call failure// `err` is an 'object' containing more information about the error});