Check our guide to getting started with webhooks on Papercups 🎉
https://github.com/papercups-io/papercups/wiki/Event-Subscriptions-with-Webhooks
- This demo is built with NodeJS on an Express server, which can be found in
index.js
- The
papercups.js
file handles API requests to the Papercups server, to do things like retrieve conversation details and send messages - Examples of our "plug-ins" can be found in the
/plugins
directory
- Calculator plug-in: a handler that takes a message starting with the word
"calculate"
and evaluates the expression coming after- e.g.
calculate 5 * 10^3
responds with5000
- e.g.
- Google Dialogflow plug-in: a handler that integrations with a sample Dialogflow agent we set up to respond to basic messages like "hello" and "test"
- NB: you'll have to use your own credentials here if you'd like to run the Dialogflow integration locally
- Custom NLP plug-in: a handler that uses our own NLP model to respond to common questions based on our FAQs (hardcoded in the code for now)
Check out our .env.example
for the environment variables that are used in this project.
# Pass in your Papercups credentials as environment variables - be sure not to keep these out of git!
PAPERCUPS_EMAIL=test@test.com
PAPERCUPS_PASSWORD=supersecretpassword
# Environment variables for Google Dialogflow (for building chatbots)
GOOGLE_APPLICATION_CREDENTIALS="/path/to/your/credentials.json"
DIALOGFLOW_PROJECT_ID=papercups-demo