This project is a node express app that demonstrates processing of event streams data that is then used to model data as it appears in flex insights reporting
As Open Source Software from Twilio Professional Services, this project is not supported by Twilio Support. This software is to be considered "sample code", a Type B Deliverable, and is delivered "as-is" to the user. Twilio bears no responsibility to support the use or implementation of this software. In using this project, you are assuming ownership over the code and its implementation.
For bug reports and feature requests, please submit a Github Issue.
This solution is provided to demonstrate how to translate the events from task router into the conversations model for flex insights and is not designed for scale. Anyone using this project should consider challenges with consuming events out of order and at large volumes.
-
Populate the given variables when prompted
TWILIO_ACCOUNT_SID
- the account sid of your twilio account - used for calling Twilio APIs //TODOTWILIO_AUTH_TOKEN
- the auth token for your twilio account - used for the authentication of requests //TODOLOCALE
- Locale as setup in flex insights eg en-USTIMEZONE
- Timezone of flex insights eg "UTC" or "America/New_York"
-
You're all set, the backend is ready. You can access it on https://<HEROKU_APP_NAME>.herokuapp.com
- Clone repository using
git clone https://github.com/twilio-professional-services/twilio-event-streams-reporting-example.git
- run
npm install
- clone the .env.sample to .env
- update .env as appropriate, descriptions above
- run
ngrok http --domain=<preferred domain> 3000
- start server using
npm start
-
Create event streams sink to point to either your heroku
https://<HEROKU_APP_NAME>.herokuapp.com/events
or ngrok domainhttps://<ngrok domain>/events
- Method: POST
-
Create event streams subscription for taskrouter (v2) events
Reservation
- reservation.accepted
- reservation.canceled
- reservation.completed
- reservation.created
- reservation.rejected
- reservation.rescinded
- reservation.timeout
- reservation.wrapup
Task
- task.canceled
- task.transfer-failed
- task.transfer-initiated
Task Queue
- task-queue.entered
Worker
- worker.activity.update
- worker.attributes.update
- worker.created
- worker.deleted
v0.0.1 - initial release v0.0.2 - added support for agent data, updated readme
Please be aware that this project has a Code of Conduct. The tldr; is to just be excellent to each other ❤️