After I've built a conversation flow in a chatbot, how'd I get the chatbot to actually perform the desired actions? - api

For example, if I’ve built a full conversational flow in a service like API. AI that results in a booking being made. How do I actually then make that booking sync to a third party calendar?
Can this be done directly between the two? Would I need to build an application to sit between the two?
I’m tech inexperienced, so I’m curious how these things work…

You will need to add "fulfillment" to your API.AI app, and yes, have a custom application (the "webhook") in between.
That is, once you've collected all the information to make that booking, you don't want to just say "Thank you, here's the book information you've provided [...]", you want to do things with it. That's what fulfillment does. API.AI will send a REST call to your webhook with the information the intent has, you do whatever you want with it (e.g.: actually add the booking to the calendar), and also return the response that you want API.AI to give, that'll take the place of the "text response" you normally provide for a given intent.
To set this up on the API.AI side, there are two steps: Find "fulfillment" in the menu for your app, and tell it how to connect to your webhook. Then go to any intent where you want the webhook to be called when it's matched, and select "use webhook" under "fulfillment".
The more involved part may be to actually provide a webhook that API.AI can call - that's where your custom logic goes, it sits between, in your example, the API.AI app and the calendar application and makes things actually happen.
Useful reading: https://docs.api.ai/docs/webhook

Related

How would I go about developing a program that automatically sends an email with the tracking number to a customer using EasyPost API?

I'm a fairly new web developer and I have an ecommerce website that integrates EasyPost to create and print shipping labels.
EasyPost has an API. Also, in each shipping label, I see a JavaScript object (I think) that displays buyer_address... "email": "example#gmail.com",, which tells me that the email information is there.
My question is somewhat general in scope: What steps would I need to take to go about creating this automation? The website is built in Webflow, so I don't really have a "codebase" or "repository" to store whatever code is needed to build the automation.
Since the buyer email is making it into EasyPost with integrations already in place, I feel that I could create a simple program that emails the tracking number to the buyer email every time a label is generated, or perhaps when package is shipped, without the program needing to interact with Webflow or other integrations.
I attempted using Zapier, as well as Make.com. Neither worked, and OrderDesk doesn't have a way to send tracking number emails.
It looks like Webflow has some kind of support for Webhooks (https://webflow.com/feature/create-webhooks-from-project-settings). EasyPost offers webhooks for free as an add-on service. Basically, with webhooks, EasyPost would send tracking events to Webflow proactively, but Webflow (or you) would need to manage the logic for what to do with those tracking events after they are delivered.
EasyPost Webhook Guide
I'm unaware of any off the shelf products that could do this for you without writing any code. We have a guide that details how you might accomplish this with Ruby (you could then follow this as an example for any other language): https://www.easypost.com/email-tracking-tutorial
A few suggestions:
Integrate something into Webflow if possible (I'm unfamiliar with the platform so couldn't say).
Build a simple script that runs on a schedule (cronjob) that retrieves your trackers from EasyPost and sends an email to customers if they have not yet received one. To your point, this approach wouldn't require interacting with Webflow at all and could be done with some local code running on a server and just your EasyPost API key.
I've created a simple UI for EasyPost: https://github.com/Justintime50/easypost-tools-ui, it could be interesting to add this particular use-case as a feature to that project. If you're interested, feel free to open an issue on GitHub for the repo listed here and I'd consider it.
You'd use easypost's API webhooks, to detect when shipment tracking information is provided, or package information is updated.
https://www.easypost.com/docs/api#trackers
It looks like it has a lot of states, so you can keep the client updated regarding the package status from the moment the tracking # is assigned;
EZ1000000001 pre_transit
EZ2000000002 in_transit
EZ3000000003 out_for_delivery
EZ4000000004 delivered
EZ5000000005 return_to_sender
EZ6000000006 failure
EZ7000000007 unknown
You can install webhooks from these docs.
To send the email, you can use an automation service e.g. Make to capture those webhook events, and then compose and send an email to that customer. I like MailJet for that purpose, because it has excellent template support and you can send from your own company domain. But there are many email-sending options.
A bigger challenge, maybe, is getting the email address to send to. I didn't spot it glancing through the Trackers or Shipments data structures, and I am primarily seeing physical address info.
If EasyPost is not tracking the customer's email with the shipment, you may have some challenge in that you'd need to capture the client info through Webflow's order webhooks, and then associate that with EasyPost's shipmentid, and store those in a reference table.
Many automation services offer database-like functionality for this purpose, or you could use e.g. google sheets ( columns webflow OrderID, easypost ShipmentID, customer Email ) or airtable for that purpose.
But you'd have to look into the Easypost integration as well, and you may need to make that integration manual so that you can acquire all 3 of those pieces of information at the same point in your business data flow.

Getting started creating a web form in Microsoft Teams

I dont know where to begin. Do I need to create an app? Do I need to use bots? I have tried finding docs online but don't know where to start. Any help with be appreciated.
I am trying to create a small form in a teams channel that my users will fill out.
User enters #projects
Web server responds with
User clicks submit and data gets posted to my web server.
You're correct that there are a few different kinds of applications in Teams, so finding the one that suits your needs can be a little confusing at first. For what you're trying to do, I would recommend a Bot, and when it received a message (which it will do when it receives your #mention), it can respond with an Adaptive Cards. Adaptive Cards, if you've not used them, are like small embedded forms inside the chat. The user can complete the card and click a button, and it will send the payload back to your bot to do whatever it needs.
Bots, incidentally, are basically just web services, so your bot can do whatever it needs once it received the payload, such as calling another API in turn.
You haven't mentioned what language you might want to work in, but here are some good starting point nevertheless:
https://dev.botframework.com/
https://github.com/microsoft/BotBuilder-Samples/tree/main/samples
https://github.com/microsoft/BotBuilder-Samples/tree/main/samples/csharp_dotnetcore/57.teams-conversation-bot (I've linked the C# version - you should know that Teams bots use the same Microsoft framework as -all- bots build for the Microsoft world, such as web chat bot or a Skype bot. As a result, you have to ensure that anything you look at is applicable to Teams as some content/samples are not)
https://adaptivecards.io/ (as with Bots, Adaptive Cards have a life outside of Teams, so some articles/content/etc. might not be applicable to your scenario)

In Square, when we mark an Order as Ready, is there any way to get Square to notify that user via email or text?

With the new API, it is great that we are able to push orders to the POS app - now I just need a way to notify customers that the pick-up is ready. I have my own system seperately right now, but is there any way to do this inside of Square. Or even better, is there any way to hook into a square event?
I see webhooks, but only things like payment, refund, dispute events. Is there any way to catch an order status change?
Currently there are webhooks for different order update events:
You could then create some webservice of lambda to process such webhook payload, and submit an email using some 3rd party email sending solution.
There is a challenge that since you will need to query the square api for the rest of order details, you will need to create a square app, implement oauth etc.
Unfortunately, there's currently no Order webhooks at this time. Webhooks are definitely an area Square's APIs have been focusing and improving lately, so I suspect this to be an area we continue to improve. With that said, there is no ETA on if/when this is coming, sadly we do not share public timelines.

How to place calls with IVR with S4B

I need to build a PoC where I can automate the process of calling people, putting a IVR with two option, and then register that option again in the database.
I need this to be able to make several calls at the same time (about 10).
Is this posible? So far (Im new with this), I've just found how to answer calls and do the IVR process, but I need to place calls. For example, this is seems to be what I need, but it's for answering, not placing calls:
See Post
BTW, this is for external numbers, phone numbers, not just S4B users.
There's no way to do outbound calls without a person dialing it, at least at a native S4B layer. See here the one community specialist answer.

How to get notification subscriptions in Worklight

I want to trigger VERY basic push notifications, but, don't see any way to iterate through all the subscribed users, without rolling my own tool to read the db notification_user table. Surely, with such an extensive (and expensive) product such as Worklight there is an API to do this?
The only way I see is within my adapter to call another HTTP adapter (go get the user subscriptions). And, I've tried using the HTTP interface to retrieve the subscribed users via:
http://<server:port>/<context>/console/api/push/get?adapterName=PushAdapter&eventSource=EventSource
and many variations, but, nothing seems to work through browser testing (the doc indicates all are GET requests). There are NO examples of how the "Push, Event Sources" (?) format for the api is (should the "API Context" value be "Push", or "EventSources", what?). The chart given in the Worklight 6.0 Information Center is pretty bare minimum (how difficult would it have been to include an example of each?)
Basically, I want to iterate through a specific adapter/event source in a WL adapter, grab the "options" that were passed in when the user subscribed to perform some business logic on whether to send out a notification. Would think this would be a very common pattern, but, don't see any examples of this type of model.
Anyone have suggestions for similar processing with WL 6?
Thanks.
You're not wrong. Worklight has 3 methods to send out notifications to subscribed users/devices
See
WL.Server.notifyAllDevices
WL.Server.notifyDevice
WL.Server.notifyDeviceSubscription