Connecting Your Chatbot Service’s Messaging API to Hootsy

Hootsy currently supports built-in integration with Lex and DialogFlow, and custom webhook integration. The custom webhook integration allows you to connect any chatbot service’s messaging API to Hootsy.

Hootsy’s messaging structure closely matches Facebook’s so the custom integration will need to ensure the messaging structure is the same as what is sent to Facebook to ensure it is handled correctly by Hootsy. For more info on the our messaging structure, see the developer docs.

In this example, we’ll convert the DialogFlow v1 API to Facebook’s format and then send it to Hootsy. See sample code on glitch. Feel free to remix this code. Note: this example assumes you’ve already created a chatbot in Dialogflow.

First, we’ll create the assistant in Hootsy. Expand out the Conversation section in the left menu. Set source to Custom, define the webhook URL (in our case: https://hootsy-custom-webhook-dialogflow.glitch.me/webhook/), and generate an Access and Verify token.

In Dialogflow, grab the V1 client access token.

You now have everything you need to connect Dialogflow and Hootsy.

In the sample code, open the .env file.

Set the following:

  • H_ACCESS_TOKEN and H_VERIFY_TOKEN to the values in Hootsy.
  • DIALOGFLOW_V1_TOKEN to the value in Dialogflow.
  • H_SEND_URL to ‘https://ws.hootsy.com/api/send’.

Thats it! You should now be able to go back to the assistant in Hootsy and interact with it.

If you run into any issues, let us know – support@hootsy.com.

Leave a comment

Your email address will not be published. Required fields are marked *