@zenvia/sdk
Version:
This SDK for [Node.js](https://nodejs.org/) was created based on the [Zenvia](https://www.zenvia.com/) [API](https://zenvia.github.io/zenvia-openapi-spec/).
22 lines (18 loc) • 498 B
JavaScript
/**
* Example to show the report about current state of sessions (executions) of flows in a period.
*
* Run:
* ZENVIA_API_TOKEN=your-api-token node reports-list-flow.js
*/
const { Client } = require('../dist');
const client = new Client(process.env.ZENVIA_API_TOKEN);
const reportClient = client.getFlowReportClient();
reportClient.getEntries({
startDate: '2020-01-10',
})
.then(response => {
console.log('Response:', response);
})
.catch(error => {
console.log('Error:', error);
});