abcnews/chatfuel-google-sheet

Name: chatfuel-google-sheet

Owner: ABC News

Description: Append values from ChatFuel to a Google Sheet

Created: 2017-06-14 06:35:16.0

Updated: 2017-11-16 13:44:30.0

Pushed: 2017-08-08 05:47:04.0

Homepage: null

Size: 27

Language: JavaScript

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

Chatfuel Google Sheet

A JSON endpoint to send Chatfuel user attributes to a Google Sheet.

Setup

This app is intended for use in AWS Lambda. General setup:

  1. Configure this app as an AWS Lambda
  2. Set requisite env vars (see below)
  3. Expose via a web gateway
  4. Set up in Chatfuel as a JSON API card
  5. Configure this as a POST endpoint
  6. Send through and Chatfuel attributes you wish. Each attribute will be added to a new column in the doc.
  7. Add a query param to the url to let the endpoint know which sheet to send to. Eg. ?id=123 where 123 is the id of the sheet, as found in the url.
Environment variables

Environment vars for this app are configured from two sources:

  1. client_secret.json file from the Google Developers Console. For instructions on setting this up, see step 1 of the Node quickstart docs.
  2. Once you have the secrets set, run the auth script to get an access token: node util/auth.js

Variable name | Description
———————|——————— SHEETS_CLIENT_ID | Client ID as found in client_secret.json SHEETS_PROJECT_ID | Project ID as found in client_secret.json SHEETS_CLIENT_SECRET | Client Secret as found in client_secret.json SHEETS_ACCESS_TOKEN | Value as printed by the auth script. SHEETS_REFRESH_TOKEN | Value as printed by the auth script. SHEETS_TOKEN_TYPE | Value as printed by the auth script. SHEETS_EXPIRY_DATE | Value as printed by the auth script.

Chatfuel variables

It is intended that you can throw any variables you like at this endpoint and they will be saved as columns in a sheet.

It is worth noting that Google Docs has a limit of 400k cells in a sheet. Therefore this is not an appropriate tool for larger-scale or long-term data gathering.


This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.