UNPKG

@elasticemail/elasticemail-client-ts-axios

Version:

Official ElasticEmail SDK. This API is based on the REST API architecture, allowing the user to easily manage their data with this resource-based approach.

29 lines (22 loc) 733 B
/* Initialization */ import { Configuration, StatisticsApi } from '@elasticemail/elasticemail-client-ts-axios'; /* Generate and use your API key */ const config = new Configuration({ apiKey: "YOUR_API_KEY" }); /** * Load channels stats * Example of loading your channels' statistics */ const statisticsApi = new StatisticsApi(config); const limit = 0; // number const offset = 0; // number const loadChannelsStats = (limit: number, offset: number): void => { statisticsApi.statisticsChannelsGet(limit, offset).then((response) => { console.log('API called successfully.'); console.log(response.data); }).catch((error) => { console.error(error); }); }; loadChannelsStats(limit, offset)