Gohighlevel plus twilio and making/triggering an outbound ivr - ivr

First, I don't know how to code. Tools I have-twilio, gohighlevel and zapier if needed.
What I'd like to do is to trigger and automated outbound call, based on a tag in ghl, that connects to an ivr.
I built the ivr in console and appears to be working fine when triggered by an inbound call. I'm trying to figure out how to trigger an outbound call using the rest api.
So perfect situation is contact in ghl gets tag applied that triggers the rest api to make an outbound call... GO..! lol

Related

Azure bot responses to webhook

Is there a way for bot to send responses to my webhook?
Direct-line channel works fine but communication is done via websockets or via polling. I would like to have an option where bot sends responses to my rest api endpoint.
I've tried to create an adapter but in that case I have to manage all the conversations logic and incoming/outgoing messages.
What would be the best solution for this?
ps. I'm using bot composer to create bot.
There is no out-of-box way to additionally send responses to your endpoint with Composer. You can use the Send an HTTP action in composer, but that is for specific and isolated calls.
What would be the best solution for this?
Are you wanting to send all responses to your webhook? or just make calls to your webhook under certain scenarios?
I'm not sure i'm understanding the ask entirely, but if you are just wanting to send responses additionally to your endpoint (not changing the response back to the channel connector and client, etc), you could create middleware. Depending on your specific needs, you might even be able to utilize/inherit/customize the inspection middleware.

In Google DialogFlow CX, is it possible to call on an external API, then get the callback response after 15min?

I am using an exteranl API that do some work for 15min, when it finish it will call any URL you define in your initial request to send the results to.
Is it possible for dialogFlow to accept this result in 15min? Is there like a built-in async response handler in DialogFlow?
If you are calling external APIs via webhook, it would be subject to the maximum webhook timeout limit of 30 seconds. After the response timeout is exceeded, Dialogflow invokes a webhook error or timeout built-in event and continues processing as usual. Therefore, Dialogflow would no longer accept webhook responses more than the set timeout limit.
Note that conversational interfaces are meant to be designed as a continuous message exchange between the end user and the app/bot. If your web service requires more time for executing operations in the background and this cannot be optimized, consider redesigning the conversation flow in such a way that end users don't wait for the app/bot to reply for more than the set webhook timeout limit.
If you have your own custom application (integrated using APIs or Client Libraries), you can instead call/invoke the function that needs 15 minutes of work (let’s call this function_1) from your custom application.
Here’s a basic setup:
User enters a query from the interface of your custom application.
Your custom application sends the user query with the Detect Intent
request to the Dialogflow agent (using APIs or Client Libraries).
After your custom application receives a Detect Intent response from
the agent, you can create code to get the intent name or event name
from the detectIntentResponse.queryResult.match.intent.displayName
or match.event response json respectively and then call/invoke
function_1 based on the intent or event matched.
Once function_1 is finished processing, you can either send a direct response to the
user in your custom application’s interface or send a Detect Intent
request to your agent so it matches an Intent and sends the intent
response back to your custom application.
No, it won't be possible as you describe it. The only way to call external services is through webhooks, but these are thought as calls that return a very specific object which Dialogflow then returns as an answer to the user directly, so they are inherently synchronous.
What you could do instead is think of a workaround. I don't know the specific of what service you're calling, but you could set up a small server to handle the webhook response from dialogflow which doesn't do anything except trigger the call to the external api, and when you get the answer you could process it (put the relevant content inside a "fulfilment" object as per Dialogflow specification) and trigger an event in your agent through the dialogflow API.
so the final process could look something like this.
user asks for e.g. "pizza": the right intent is triggered and the route for that intent calls a webhook server
your webhook server receives the call from dialogflow and calls the external api asking for the list of all pizzas ever created. it returns an empty fulfilment to the server
when the webhook server receives the response after 15 mins it triggers an event in the agent (look into the dialogflow api for your programming language of choice: python, node, java) and injects some parameters in the request, which you can then use to form a sentence in the agent
when I was just starting out I found this very useful to get a grasp of what the platform expects you to do in terms of interacting with external services, take a look at the graph especially which I think makes it clearer

How to make Slack app send a private message via an incoming webhook to someone specific?

I created a Slack app that sends a series of interactive messages to a channel. In my Slack API dashboard, I see that I can create and remove hooks. Right now the hook url that I have set up in my code is the one for the Slackbot channel.
But the problem is that such a message only gets sent to me.
I want to send the Slackbot messages to Alice in situation A, and to Bob in situation B. Not just to myself, the guy who configured the app.
What's the best way to do this?
I would suggest that you should not use hooks for this. A more sane way to do this right would be via chat.postMessage Web API method which is documented here!
This is because hooks are tied to specific conversations and that approach quickly hits a wall on what it can really achieve, especially messaging different people. Once you start using the web API it's pretty simple. Just ask for the scope during app installation (remember to add that scope in your dashboard), subscribe to the event in your API dashboard and then you are good to go.
Everytime you send a message via that method, Slack will send you a payload which you can use for testing and logging etc.
You can see all the different ways to message programmatically inside Slack here.

Twilio messaging service and studio flow

I am working on a project in Twilio and Podio, where I am using this code from Podio using POST
POST IN PODIO
FROM URL: https://[(Ref Setting) Setting Value 1]:[(Ref Setting) Setting Value 2]#api.twilio.com/2010-04-01/Accounts/[(Ref Setting) Setting Value 1]/Messages.json
POST PARMS: To=[(Ref Lead) Mobile Phone]&MessagingServiceSid=[(Ref Setting) Setting Value 3]&Body=[(Variable) strMessages]
---This works fine, and I can send my message no problem, I am using a MessagingServiceSid because my volume has increased I have about 4 numbers in the messaging service.
The problem I am encountering is I had a Twilio Studio Flow set up to handle the incoming text messages when I was just sending from the sid, and I am wanting to figure how if I can make sure that when someone responds to my messages they get sent to the studio flow set up to handle the responses. I am also wanting to get the responses back into Podio.
I have tried changing the Numbers settings in messages settings to that particular studio flow, but when I do that, it takes the number out of the Messaging service that I am using to send the messages.
You need to assign numbers and studio flow to a messaging service.
To assign a number to messaging service:
While configuring a phone number you need to go to its "messaging" section and configure with the messaging service.
To connect messaging service and studio:
1) Goto studio flow -> click on the trigger -> copy the webhook URL
2) Goto messaging service -> inbound setting -> paste the URL in request URL
To get the response back to your servers(I am not familiar with Podio), add an HTTP request block in your studio flow. In that add a request URL pointing towards your server and in the request body you can add the body of text which looks something like FROM:{{trigger.message.From}} BODY:{{trigger.message.Body}}
I tried to follow Abhijeets answer, but unfortunately due to the way messaging services and Twilio phone numbers differ, it's not possible to have the SMS replies work correctly.
I tried to do something similar to you. I was triggering the Flow execution by POSTing to the REST API url trigger, and I used the "Send & wait for reply" widget to send and receive a reply from a number. It worked perfectly when only sending from one phone number, but when I switched the "Send & wait for reply" widget to use a messaging service to send it instead, the responses always triggered the "Incoming Message" start of the Twilio Flow. So it made an entirely new execution, and my previous execution never was completed.
After reading a lot of documentation I could never get around this, so what I did was instead just purchase and assign additional phone numbers to the Twilio flow. In my application, I triggered the Flow execution using these phone numbers (randomly), and then the "Send & wait for reply" widget used this phone number to send out the text message. That ended up working for me, since I was only using messaging services to send out SMS messages with multiple different phone numbers.

Creating a Slackbot that adds

Hey in my team's slack (messaging system for those who don't know) we have an automatic response, so that when anyone says "trump", slackbot automatically responds with "the wall just got ten feet higher". Now I want to make a counter that essentially allows slackbot to state "the wall just got ten feet higher, wall height:(have a updated value according to number of times "trump" has been stated)" So basically I want a way to have a value that updates the wall height but I am lost on how to do that within slackbot. Any help is much appreciated, thanks to all!
The default features provided by Slackbot only allows it to respond to keywords, but not much more. So to provide that additional feature you would need to develop a custom bot.
For your use case I would recommend building a so called internal integration for Slack using the Events API.
Internal integration allows you to add custom functions for your Slack team only (as opposed to a full fledged Slack app, that could also be installed and used for other Slack teams).
The Events API allows you to set up a bot that listens to messages and can react to keywords like "trump".
An alternative approach to the events API would be the outgoing webhook. However this function is now deprecated and should no longer be used. Also it only works with public channels.
To set this up you will need to develop a small webservice (e.g. in PHP) that listens on a webserver for requests from the events API, keeps count of how many times the keyword has been invoked in the past and sends an appropriate message back to your Slack team every time the keyword is used.
I can recommend reading the excellent official Slack API documentation if you want to learn more.
If you are familiar with PHP this can be done easily using the Slackbot Framework. It supports Events API allowing you to listen to messages in channels or direct messages (depending on the permission scopes of your APP). So all the conversations on Slack can be sent to your server and you can search for the specific keyword in every message. Then send back an appropriate message to Slack. In summary, the first step is to create an APP for your slack team at https://api.slack.com/apps?new_app=1. Next step is to install the Slackbot Framework which is explained here. Hope this is helpful.
That can also be done by integrating custom slack bot using Django. You'll have to subscribe events and based on events, Slack will send conversation message to the given url, and based on the event, you can write your logic to increase count and post message back to slack work space.

Resources