abcnews/chatfuel-hearken-questions

Name: chatfuel-hearken-questions

Owner: ABC News

Description: Get questions from your Chatfuel audience to Hearken

Created: 2017-11-13 05:15:25.0

Updated: 2017-11-16 13:45:53.0

Pushed: 2017-11-15 01:01:48.0

Homepage: null

Size: 15

Language: JavaScript

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

Chatfuel Hearken Questions

A JSON endpoint that takes input from ChatFuel and sends it to Hearken.

Setup

This app is intended for deployment with Google Cloud Functions. Deployment via the Serverless Framework is recommended.

Chatfuel setup:

  1. Set up your Chatfuel bot and then add a “JSON API” card.

  2. Set TYPE to POST.

  3. Set the URL to the endpoint URL that Google Cloud Functions gives you. It will be similar to this:
    https://us-central1-purple-monkey-154837.cloudfunctions.net/hearken?sourceId=361&hearkenUrl=abc

    Note: For sourceId replace the 361 with the number of your hearken submission embed ID. Also for hearkenName replace the abc with the name/subdomain of your Hearken instance.

  4. Include the following Chatfuel user attributes: {{ first name }}, {{ last name }}, {{ email }}, {{ formResponse }}, {{ messenger user id }}, {{ PreferAnonymous }}

    Note: email can be “No” or any string that isn't a valid email address if the user doesn't want to provide one.

Response

This function will tell Chatfuel to redirect to a “Hearken success” block if it is successful and a “Hearken error” block if there is an error submitting the user information to Hearken.

It will also set a user attribute in Chatfuel {{ hearken_id }} to the id number of the Hearken embed.

Optional user attributes: {{ location }}

Author

Send bug reports to Joshua Byrd or log an issue.


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.