Connecting your AI bot to 1000’s of applications using Zwerm, Zapier and Dialogflow.
Out of everything available in the market, these are three powerhouses of flexibility and strength. So what can you do with just these three tools and no coding? More than you think! Literally 1000’s of things. As our first example, we’re going to give users a special discount code when they provide us with their email address. So let’s create a small bot that will collect some data and send that to an email address and store the data it in a Google sheet. From there your imagination can go wild!
So what do you need?
- First, you need an account with Zwerm, Zapier and Dialogflow.
- Setup an agent in Dialogflow.
- Add a bot in Zwerm and Connect Dialogflow
- Start creating a conversation.
- Make intents in Dialogflow and create all the questions you want the user to answer.
- Add one extra intent which we are going to name “Get a special deal”.
- Use as the utterances “Get me the deal”.
- Create two parameters @name and @email and make them mandatory.
- Also ask @approval, “Are you okay with receiving marketing messages from us?”
- Create the prompts for when these parameters are missing.
- Now add a text response to indicate to the user that we have all the data and he/she is done.
- You can now execute the response.
- Add a custom payload response.
Add a Custom payload response. Put the following code in.
{ "#StaMP": true, "from:": "server", "type": "event", "event": "your.event.name", "payload": { "name": "$name", "email": "$email", "approval": "$approval" } }
(See https://github.com/zwerm/StaMP for a description of all message types.)
You can use $parameter to use any values referenced in the Action and parameters section.
Now it is time to go back to ZwermIAM and add a Zapier webhook to your bot.
In order to use any data from the payload, you need to complete the “Pull in Samples” step for the “Catch Hook” trigger.
- Create a Zap and choose webhooks
- Click “Catch Hook”
- Take the webhook URL and post it into the integrations section of Zwerm IAM
- Click Test
- In Zapier confirm “Okay I did this” – Zapier is now waiting for your event
- Open your bot in the Zwerm App and message it to trigger the intent
- Zapier will pick-up the incoming event and say “Test successful”
- Click “Continue”
- Congratulations, you can now use the payload data in your actions
- Repeat this, any time the structure of the payload changes.
- Configure the filter to only listen to your.event.name (you can change this to have multiple events dealt with differently in Zapier)
- Go back to Zwerm and enter “Get me the deal”
- Complete the answers to the prompts and,
- In Zapier go back to “test this step” and retest until you get the payload with the correct information
- In Zapier add a new step
- Click Email
- Add a “Send Outbound Email” action
- Select correct information for each field (“To” field uses $email etc.)
- Add a second trigger which will store everything in a Google sheet.
- Create a new row
- Connect your account
- Select spreadsheet and worksheet
- Indicate which parameter goes into which column
- Finish and name your Zap
- You can now go in to Zwerm IAM and test
- Try saying “Get me a deal”
- Answer all the bots questions and check your Google Sheets to see if all the data has inputted correctly
- Now play around in Zapier with different actions and try to get the bot to do something different.
Useful Guides to expand on this are:
Building a Zap: https://zapier.com/learn/getting-started-guide/build-zap-workflow/
Configuring your bot in ZwermIAM: https://prefer.atlassian.net/wiki/spaces/ZWER/pages/178782257/Configuring+bots
Adding intents to Dialogflow:https://dialogflow.com/docs/intents
Now send us your solutions! We’re keen to hear what you made.