logo

NJP

Virtual Agent Academy: Low-code API integration with Virtual Agent and Flow Designer

Import · Dec 16, 2022 · video

as always feel free to visit our virtual agent and NIU Community there you'll find the latest content and the latest questions and answers feel free to go in there if you have questions post questions if you have answers post answers thank you everyone for for those of you who have visited thank you for for visiting our apartment hopefully continues to be a source of knowledge and inspiration all our academies are recorded and uh it will be posted on YouTube within the week and so if you like what you're seeing and if you're watching via YouTube uh please click this uh please like or subscribe to the channel and that way you'll get notified of all the latest videos that we upload you can also see a view past recordings on YouTube as well new name same awesome Academy so uh we announced this last time but I'm going to re-announce it here um the virtualization Academy is going to be rebranded to the conversational interfaces Academy that name is going to start in January 2023. we're going to talk about uh agent chat and sidebar we're not on top we're not going to talk about AWA we're not going to move that to a separate Academy I should have changed on the slide but we're going to talk about agent chat and sidebar sessions along with virtualization nnlu under one Academy name so we're going to basically do some uh alternation right so uh first Tuesday we'll talk about virtual Aging for example and this and then the alternating Tuesday we'll talk about aging chatter sidebar and back and forth Etc uh no scheduling or registration changes required on your part we will automatically registrate register you to that new Academy so I tell your colleagues spread the word So today we're going to talk about low code API Integrations with virtual agent in other words how do you how can you use all the public apis out there on the internet to plug that into your virtual agent and uh to create a workflows that you and your organization may be interested in with me today is Chris Spanky he's a senior advisory solution architect and he's going to be doing the the demo or the exercise today here's our brief agenda so some overview and FYI so overview so as of the Quebec release uh you can call public apis as part of your virtual conversation via the integration Hub integration in Virtual agent designer so that's actually a a Quebec release feature where you can integrate any action or flow from integration Hub directly into your virtual agent whether you want to integrate online information or online processes into your servicenow workflows you can do that uh low code so some examples you see on the right here uh weather API that's actually a demo that we actually saw last year with Travis Rogers so if you want to look at that how to enter how to uh insert more flow into your virtual integration Hub I believe that's what the academy was called so there's that option music brands has a public API Twitter has an API I know some shipping companies do like UPS and FedEx they have public apis so as long as you have an API key or you have the API available you can insert that into your virtual agent flows some call-outs so not only of course you'll need a pro or Enterprise license or virtual agent you'll also need an integration Hub license so I believe there are varying levels to that uh starter is all you need I know it goes up to uh professional I think for integration Hub as well uh or or Beyond but you at least need some integration Hub license it does consume integration Hub transactions and I do know there is a per action uh cost I think um some dollar amount per 1000 transactions or per 5000 transactions uh check your check with your AE on that so just be sure to actively track uh perhaps weight limit usage just to avoid surprise costs uh if your virtualization is very popular which I'm sure I'm sure it is you know just want to make sure that you're not going to overly consume more than you'd like and finally just to call out when you're using and consuming a public API data is being sent to and from a third party so obviously if you don't want uh your users to send uh in you know uh private information to an API don't build it right or just be aware of the type of information that uh users may send to that API for processing uh just to be just just for a full awareness there okay so with that uh I'm going to turn over to Chris for the exercise and these are like the brief steps we're going to go over how to get how to get an API online right internet empty the internet how to create a rest actions book be a flow designer and how to use that action uh spoke in Virtual agent in a virtual agent topic node so uh with that Chris I'll hand it over to you all right fantastic thanks Victor um hi everybody my name is Chris Steinke and I am one of the specialist solution consultants in the organization um which means that I focus in on just a particular area and the area that I focus in on is what we call our platform intelligence or now intelligence products and intelligence to us means uh in a lot of cases all this data all this information that you have in your system and how do we get benefit how do we get some value from it I support our prospects our customers our account teams when they want to have these next level discussions today we're going to be talking about creating an API call from a bot um this might be into another chat bot it might be a publicly available API this is just sort of a high level example of how to integrate uh virtual agent and using flow designer and and surface that information in your conversations now in order to find an example um Victor mentioned weather.com I just I just Googled joke apis there's a number of these joke apis that are out there and available I'm not familiar with this one this isn't a um this is an endorsement of this particular site over any other it was just a very easy and open framework which I could then integrate with um so here if we if we scroll down we can just see some basic information about the joke API capabilities uh how you would format the joke different items like things like flags and then instructions on getting started now um you might be able to code this in uh to say uh rest API or uh in a in a business rule but I cannot I really am not a good JavaScript coder um get a joke API I'm not a good coder I I can copy JavaScript I can't really create it myself so this you the opportunity to use the flow designer and integration Hub is the only reason that I am capable of of doing this um we've got our action here and that's what we are going to use to call the API and to deliver the information to the virtual agent when you click the plus button next to inputs it opens up a variety of different actions that you can perform most of these are are pre-configured actions the one that I want to call is a rest integration you can see there's a variety of setup steps and now we'll walk through setting those up now you can use a connection Alias like if you have a a key or you need to pass it different credentials you can do that in a in a connection Alias record in this case there's no authorization needed for this API so I don't have to do that which makes it a little bit a little bit easier I can just Define it in line now there is uh there are a few different base URLs that they offer for this I'm using the standard joke uh URL and then I've added any safe uh comment to it so that puts it in safe mode so that we make sure that the jokes aren't safe for work there's additional filtering options that you can look if you want to investigate the API again to make it more uh friendly and not offensive so it's going to build the request manually I'll use the get request for headers and parameters for this I just need a single parameter I'm just going to put in format and XML basically what this does and feel free to jump in because again I'm not I'm not the expert in this integration but it takes all these different elements that I'm putting together and it assembles them into a URL which it sort of pushes to the uh the API address and then it's going to return some values to us now one thing I noticed When developing it it doesn't it doesn't like that base URL it doesn't like this sort of safe mode tag that I've been added on but it will go ahead and test uh regardless so I can run a test it's now going to process the action and by clicking on it I have all my information and this step is really important we're going to need to grab some of the text from this in order to to process it um so here we can see this is the information that we sent over and then this is the response body so it automatically formats this and sends it back to us and then we're going to need to sort of figure out how to extract both the setup and the delivery again if you know scripting you could probably do this I don't so I can use a action here and there's this really great action called a Json parser and basically this is gonna parse that that Json that I had shared earlier it's going to make it really easy for us so what I'm going to do is I'm going to take my response body you know as you're building out these different steps it's going to enter in this whole data model for it and variables or other things that you have created are going to end up being data pills over here and accessible so I want my response body to be my source data for Json parsing I'm then going to paste in that data as an example and then I will generate the target and this is going to map out that entire Json structure for me and I can then use it as use it in the data pills rather than having to use it or code it in or create new variables it's a really nice easy simple step the last thing that we're going to need to do is uh to make this output happen right we want the outputs uh to be to be provided back to the virtual agent conversation and I'll create that output I'll call the first one uh joke set up College setup and I'll create another one and we'll call it joke punchline and I'll save it and now we'll run it through a test and again when you're running it through the test it I mean it's effectively doing the transaction but it formats it all into this nice little summary so that you can extract it and see more easily what's going on um so we can see here that uh it pushed out the uh the body it got my information back here it did get the joke in um and then down here it goes into the different payload the configuration the parsing of it and then um the root information here if you have any questions feel free to type them into the uh to the chat um Victor will be paying attention to those as well we'll answer those uh as we go if you have any suggestions I'm more than happy to hear them as I said I am not an expert at this um so it uh I've been learning as I've been going uh it's been really encouraging though it's it's nice the error messages that you get out of this system uh it's very easy to sort of track down and try to debug uh the the configuration of it when you have all these different fields when you have these data pills when you have this information so now I've I've copied those data pills so we parsed that value so I have my setup and my delivery the sort of the joke and then the punch line and now I put those over into my action outputs I'll save my record again and this time when I test we should see the correct output okay so for some reason I still don't have outputs in my in my punch line I'm wondering why that is so if you look down here status roots like a bank if I go back here you need to double check well I think we're all good here I'll go ahead and publish it now and we're good to go so now that I have my uh API I can go over to my virtual agent conversation and I can start to build that out uh building it's actually really easy there is already an option to pull in a API so I'll just go to my virtual agent designer maybe I'll go to Virtual agent first because now there's lots of designers in here and now you have a couple different options for how you want to implement this you could do it as small talk you could do it as its own independent topic you could do it as a setup topic there's a variety of different ways you can you can do it um what I found and this is just this is just sort of strange um people expect these Bots to tell them jokes sometimes um you know even though when we pick the use cases we're trying to solve for organizations are picking the use cases that bring the most value and benefit and and you know are the most uh I have the most to them but oftentimes customers are you know your customers will come to the virtual agent and they'll say Hi how are you doing or they'll say tell me Joe and if it doesn't respond um they then can get frustrated so something like this where it makes it a little more human it may not be a direct business uh value you don't have a specific requirement I don't know how we would Define it but something like this is just a small little thing that you can do that's going to humanize the bot that's going to increase your adoption that just in general is going to make uh people much uh how could I say much much more happy and much more excited uh for your uh for your features and your functions get whoops all right so here I got my get joke API you can see there are the outputs that are going to come out um next up I need the virtual agent um to to actually do the joke right so we need the virtual agent to take the data now that we're getting from our API and put it into a conversation so I'll pick a bot response and I'll just call it joke setup and I'm not coding something in there I have it I have it as my joke setup that I got from the previous API next up I'm going to do a pause and the pause is is just programmatically it pauses the conversation for a second the reason for this is is just for a variety of reasons but in this case the you know the the the uh the the beauty of jokes and the the essence of Comedy is timing so if we have them jump on top of each other with our joke and our punch line uh it's not going to be not going to be a great joke so we'll go ahead now and I'll put in my punch line and again I'm just going to select a data pill rather than having to do it myself and we can just have it in so I'll now save it and fingers crossed I'm going to take off the topic Discovery because we just want to hit this topic directly now why does it do that so it's showing us this information because this is the flow designer flow and when it's exiting something in the flow designer flow it's going to show us that greater detail um it looked like for some reason it was not liking it but I'm wondering if it's just this this any safe mode was something that I had put in uh afterwards um you can also do jokes like uh jokes programming and it'll give you programming jokes there's different category of jokes that are available and then they have different uh different endpoints as well so now that I've fixed that base URL it'll probably let me save here I can test it again all right this is interesting and I don't know if this is just a function of the the system but I think in some cases they reverse their punch line and their jokes so you get that sort of uh that sort of a action um now that I've fixed this I'll go ahead and publish it all right so that's published I'll come back here and I'll just point it at the other one save and now when I test um okay I did have this happen a couple times during testing um it would have sort of inconsistent uh inconsistent responses I'm not sure why but um yeah it did for some it did for some reason but I'll go ahead and I'll publish this now the last thing you're going to want to do is uh add it to an nlu intent and you can either like you could make this as a subtopic and you could just have it show up you could create it with its own nlu intent you have some different options for how you want to do that in this case I wanted to create it with its own nlu intent so that someone could ask you know make a joke from the service portal and it would work as expected um so here I've got my flow it's been published I've got that next up I just need to go ahead and test it via the service portal now this is a demo Hub instance that's something that we pre-configure for solution Consulting demo purposes so it can kind of be a little busy sometimes there's HR on here and there's you know a number of different features and functions but let's just see now hopefully it'll get that there we go yes that is a little strange I've got my delivery here here's my punch line and then if I look at the outputs from this uh oh it should be joke punch line maybe that's the that's the problem nice catch Dirk thank you let's see if I do inputs joke punchline oh I see what it was I had switched the um the API I think it that had done it as well thank you Dirk much obliged if I do my setup here this should still be joke set up we should be all good foreign now let's try again here second tier I just need to start a new one hmm strange so for some reason I'm still not getting my output I mean that might be something that I had done or had switched from the uh well it says uh I think you need to publish oh is that at my the flow or the topic the topic I always seem to get forget to do that thank you sir yeah I forgot to do that in my last Academy that's uh yeah it happens right uh let's see here all right this is the part where I go to a recorded video that has it actually working well thank you Chris for showing I think you know um you can definitely check out the YouTube video I shared in the chat that shows just another example uh another example of using ihub for API I'm just going to go through the question super quick I know we're short on time here what kind of additional content type we can add to the virtual agent conversation to increase the engagement except text uh you know there's a variety of um response type you can use such as images links even HTML as well and it's all about like what your users are looking for for HR and then rather than hiding the topics well I use the word high to Loosely hiding the topics behind do you try to having to type something in to get a response you can always pin topics to your greeting via promoted topics so that way people can see those topics available you know right up front in the greetings and then you just click it and get a very rich response either through an API or through um you know images and other types of media videos another great example um another anonymous ask when is the virtual agent Academy on chat GPT a good question funny story we were going to do this Academy on using Chachi between an example but Chachi BT number one it's still a beta slash research project it could be turned off at any time uh these other apis have been around a lot longer right so you know your you know your mileage may vary but you can certainly apply this methodology to a public API such as chat GPT just be aware of you know any privacy concerns or data concerns you had when you send information back and forth to to chat GPT um and then yeah there were some other uh suggestions do you know if we can do multiple apis and multiple spokes in a single topic yes you can like you could probably pull that action spoke into um uh a topic as and many times as possible Right for multiple times so yes definitely possible definitely different apis can be used in a single conversation cool so I think those are all the questions again thank you all for your participation thank you all for your uh for your feedback uh we will again we will put this video on YouTube and then um so in the following Tuesday we will not have an academy because it's the holiday December 20 whatever it is but we will see you again next year in January January uh 2023 I believe January 10th is is the first Tuesday after New Year well that isn't on New Year's so we will see you have for the so everyone have a great holidays and a great new year thank you everyone thanks Victor

View original source

https://www.youtube.com/watch?v=qDZKL5vy6X8