Lesson 13 - API/Webhooks & Zapier: App Connectivity β
Start an AI Automation Businessπ
2024-07-31
Transcript β
[00:00] welcome to the next lesson here where we're going to be exploring everything you need to know about web Hooks and zapier the specific use case of why a web hook would come up in an a automation is when zapier doesn't natively integrate with a specific feature from one of the apps you're trying to use therefore this allows it so we can still build out that functionality you want but we may just need to use a custom API call now there are three main reasons why you would use a web hook in an automation the first being that zapier just doesn't support
[00:30] your app at all therefore we're going to have to go to documentation to understand how to integrate that into an automation the second reason would be that zapier supports the app but they don't support a specific action within that app and then the third reason is that they support the app they support the action but within the action there is a specific variable that we still can't add data for okay let's go ahead and jump in and understand everything we need to know about web hooks to do so we're just going to go ahead and begin and let's do a web hook here do web hook and let's go ahead and explain all the
[01:01] different events and what they mean the first thing you should understand about web hooks is not only can they be the trigger but they also can be the action the context that we use a web hook as a trigger and we use the event of catch hook and we go ahead and get a URL here essentially what we're doing here is we're waiting for data to be sent to that specific URL and to be used in the automation flow now if you're using a web hook as an action you have three main choices here you have get post and put get get is essentially going to grab
[01:31] data from another source or maybe another third party app post is essentially going to push that data think of it like postmail put allows you to create new data or update existing data finally custom requests allow you to patch or delete but in the context of a automation we were mostly use either get or post so before we jump into a live example here let's just go ahead and figure out how we'll find the documentation for the specific app we're working with typically all that requires you to do is type in the app's name so for this example we'll type in CER we're
[02:02] going to type in API documentation go to the first option here and as you see we are at the documentation now some apps have better formatted documentation some apps have worse formatted documentation but typically the way you go ahead and observe is you're going to come over here as you see it has all the different capabilities we can call upon so as an example if we went to activity log list activity log entries you will notice we have the URL here and we have the function of G like we referred to
[02:33] earlier here is a different option in the documentation the function of post and then the specific URL so for today's example what we're going to do essentially is with the trigger from MailChimp there is an event here that we can't necessarily do in the context of a specific subscriber changing their email address as you see there there is no way we can incur this action so we're going to use a web hook instead we going to go ahead and change this event back to web hooks we're going to do an event of catch hook continue continue let's go
[03:06] and test it here we go we don't have to test it yet because we actually haven't sent any data to it yet we're going go ahead and copy this web hook and let's jump over to MailChimp coming over to MailChimp and audiences we're going to go ahead and simply find web hooks now just for your context anytime you want to deal with web Hooks and thirdparty apps they will always typically have a whole tab dedicated towards it so for more reference here if we go over to calendar le as you see here if I go to Integrations web Hooks and API calls are found right there but for this use case
[03:38] since we're looking at MailChimp we're going to go over to settings we're going to hit web hooks we're going to go ahead and take the URL that we just had for the trigger paste it here so now it's listening for this event to incur we're going to go ahead and uncheck box because we're looking for when the user changes their email address so email changed there we go we're go ahead and Save perfect so we went ahead and configured that web hook here let's go ahead and make sure it can get example data here so we're going to go ahead and go to one of these uh subscribers to our list here
[04:11] we're going to go ahead and change the email address here so me add like a 1 two three and then we go ahead and save change perfect let's go ahead and Trigger that action get some test data going here and there you go so the original old email was courses and now the new email that it just triggered for is courses 1 2 3 three that we just created together so in this context maybe what you want to do is then send it as a Gmail so going ahead and make a Gmail block here and I'm going ahead and did an event of send email continue we're going
[04:43] to choose our courses account here continue again we'll input that into the body we're going to say old email for subscriber semicolon put in the old email here because they gave us the old email from that data point do new email semicolon and then we can put that there send that off so essentially what's occurring here is that the web Hook is waiting for data to change specifically for any subscriber for the email address when that incurs it'll run this flow really cool stuff now looking at the
[05:14] test data here from stripe if you're looking for the web hooks here a lot of apps have a nice little search Bo if I just typed in web hooks it'll take me directly to their version of the web hooks on their back in So if I say add endpoints this is where I would put in that zapier URL to do different functions within zapier's documentation now let me show you a real quick little tip here on how to troubleshoot errors you face when dealing with web Hooks and apis because it can get pretty complex here essentially we can use chat gbt I'm not going to do this all live but in theory
[05:45] if I really wanted to what I would do in the context of calendly API documentation is I would load it into a chat like this and then basically Proctor it depending on what I was trying to achieve but just for an example have our first page here from the documentation talking about API conventions I could come back here and just say we are going to finetune this chat to understand calend API documentation here is Page One semicolon
[06:19] put the link in just understand the Page hit enter from there you could add multiple Pages within the API documentation and maybe more specifically on the action that you're wondering about you would upload that web page onto chat gbt as well and just get into a one-on-one dialogue with Chad gbt to help circumnavigate potential issues you run into when dealing with web hooks now to wrap this up there are two types of Errors you could see when dealing with web Hooks and the first one being a 400 error a 400 error means that
[06:51] the actual function itself wasn't put incorrectly therefore you're going to have to refer to chat gbt or the documentation in order to make sure that you're structuring your post or get correctly if you get a 500 error that just means the app itself isn't functioning right so go ahead and give it some time try again a little bit later and it will typically resolve itself perfect now you know how to use web Hooks and call upon custom API calls within apps that may not have natively integrated actions within zapier let's go ahead and jump into the next lesson here where we're going to build out an AI article generator that you can start
[07:23] using in your own business and start selling as a service for other ones