mycaule / smooch-api-quickstart-example

Sample code to get started with the Smooch REST APIs

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Sunshine Conversations API Examples

Get started

For a detailed guide, see the Sunshine Conversations API Quickstart:

Node.js

  1. Clone the repository
  2. Go to the nodejs subdirectory
  3. Update index.js to include your secret key and key ID from your Sunshine Conversations settings
  4. Install dependencies (npm install)
  5. Run the server (node index)
  6. Use ngrok to create a secure tunnel to port 8000(ngrok http 8000 after ngrok is installed on your PC)
  7. Create a Facebook page and connect it to Sunshine Conversations
  8. Create a Webhook from your dashboard and point it at the full url for the /messages endpoint (e.g. https://MY-NGROK-DOMAIN.ngrok.io/messages )
  9. Send messages to your Facebook page and watch the auto-replies roll in

Scala

Go to /scala subdirectory.

Get a userId from your application and change

# Main.scala
val userId = "aaaabbbb11112222ccccdddd"

Setup your app keyId and secret here

# application.conf
smooch {
  keyId = "app_aaaa1111bbbb3333cccc5555"
  secret = "AAAA0000BBBB1111ccccDDDD"
}

To run the webhook microservice, just do

$ sbt run

About

Sample code to get started with the Smooch REST APIs

License:Apache License 2.0


Languages

Language:Scala 62.8%Language:JavaScript 37.2%