Skip to content

thinkfiveable/Drift-Bulk-Export-Transcript

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Fiveable Drift Export

  • Add the .env file as noted below
  • npm install
  • node db.js to create your sqlite db
  • node app.js to collect the conversations

Drift Bulk Conversations Transcript Export

Getting Started

This Node.js repository exports Drift Conversations transcripts into a CSV file labeled DriftCSV-exportDate. Conversations that meet filter criteria, are passed to CSV file upon calling app.js file.

Requirements

How to use/update this repo

Clone this repo and navigate to the repo's top level directory (bulkExport). Install node dependencies

npm install

Create a .env file at the repo's top level directory that holds your oAuth token generated by creating an app DRIFT_AUTH_TOKEN. [Here is how to create a Drift App]

Note :

Testing

Run app.js in your terminal

App Logic Flow

The Export function is triggered upon call via the terminal. The export function runs app.js which first retrieves the API keys from .env file.

Then, the Drift reports API is queried to retrieve all conversations that were updated within the provied time range, are currently closed and had an agent participate. The app then loops through each conversation returned and adds additional data via calls to Drift's other API endpoints. When the loop is complete, the app bundles the data into CSV file format and sends the associated data to ExportFiles folder via the csv-writer library.

Errors are logged in the console.

If no errors occur, all conversations initially returned by Drift are bulk uploaded to the CSV file in a separated row. Each time the app is run, a new file is generated with naming convention of execution time [DriftCSV-Mon Dec 13 2021 16:16:49 GMT-0800 (Pacific Standard Time).csv]

This app is read-only from Drift and write-only to the CSV file.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 100.0%