Webhooks! Connecting two GHL Accounts together

Created by Joanna Love Mojares Panizales, Modified on Mon, 04 Sep 2023 at 05:12 AM by Joanna Love Mojares Panizales

What we're going to look at is connecting two separate sub accounts within DHL via webhooks. When an action happens in one account, it stops a follow-up or stops an automation in the other account. Let me just open two separate accounts here between the systems, and I will show you what we're trying to achieve. I'm going to go to our mailing account for one of them, and I'm going to go to my demo account for the other one. I've got two separate sub accounts that I'm working on. Let's say, for example, this is my outgoing mail account right here. This is the one that I'm sending emails from. This is what I'm calling my marketing account. All of my emails are going out from this account. This is mail one, that's where we're sending out emails from. This is demo account. Let's say that this is where people are opting into. I've got a mailing account and I've got my main account. This is what we're teach. They've got two separate accounts, one where the emails are going out and one where the people are opting in. What we want to do is when they opt into this particular system over here, we want to stop the emails going out from over here.

We're going to create a web hook between the two companies that allow that to happen. So away we go. We're going to start with the main account. We're going to start with where our prospects are opting in. We're going to come across to automations, and we're going to build in an automation that sends a web hook back to the other side. Let's start this off. Now I'm going to need to do this in two tabs, so hopefully you guys will keep this up. This is new action. Let's say opt-in or booking. So opt in or booking. Stop follow-up. Let's say the action, they've filled in a form or they've made a booking on a calendar. Let's take the easier option there. It's a form submitted. They've opted in, they've downloaded my fact sheet or my white paper or my information. They've registered for their 23 leads, whatever it might be, they filled in a form at some point. Let me just grab a form that I've probably got here. Form is... What have I got here? Anything that looks interesting? Thousands of forms in my... Anyway, it doesn't matter. I'll just choose the first one in the list.

Cool. Done. They're filled in my form on my main account. Great. Now what? Now we actually want to send a web hook so that it stops the action in the other account. Now you need premium web hooks turned on in GL. If you don't want to have premium web hooks in your DHL account, you need a Pavee or a Zapier connection to make this next step happen. When they fill in this form, we want- Sorry, could you go more? Sure, go from me.

The premium web hooks, does it come only in the 497 plan? I'm on the 2.97 plan.

Okay. I don't know. I'm on the 497. I haven't ever gone down. Maybe somebody else can help me with that. In your agency mode, let me open one more tab, and let's flick across to agency mode. Is anybody else on the 297 that's got the premium web books? I'm just not sure if that's part of it. Agency plan and where is it? It's in settings and it's in company. In the company settings here, we've got this one, LC premium triggers and actions. Is that in your 297 plan?

Checking now. Company. This is the agency level?

Yeah. Okay. Yeah, this is your agency settings. That's the one there, LC, Premium triggers and actions.

I'm on the agency tab on the company.

Yep. -so have you got- -I have got to turn.

It on. Yes, LC, Premium Trigger. Okay, Premium Trigger is 0.01 execution. I confirm.

Okay. This is cheaper than Pably. Sorry, cheaper than Zapier. Pably is at one time. Let me put the link into the chat here. Basically, it enables web hooks within... There you go. Agency is not on any plan, 97, 97, 297, whatever it might be, can access these. You've got 100 free executions. You can turn it on or off for any of your sub accounts, which is fine, and work it through. I just popped that link in the chat there. What it does is it allows you to create webhooks, which you can then use in lots of different ways. So webhooks are very cool for firing off automation. For example, when we set up our leads program, you can fire a webhook to create a license in the leads program. You could fire a webhook to update the Xero or QuickBooks accounting software. Webhooks are an amazing way to connect digital programs together. So basically what HighLevel have done with the creation of webhooks is eliminate the need for third parties like Zapier or Pably or or IntegraMat or any of those guys. So webhooks allow two systems to connect to each other. I'll show you how they work.

Now we've got this form being submitted, we're going to add the action, and now action is a custom webhook. When we have a webhook, a webhook needs two things to operate. It needs a URL where it's sending the information to a specific URL, and it needs the information that it's sending. It needs a place to send it to and the information that it's actually sending. Where do we get this URL from? Okay, well, this is where we're actually going to start to bounce between these two open tabs here. When they fill out this form, I want to fire a webhawk and I want to send the webhawk information back to the other account to stop the followups. Now I need to create the basket to catch the webhawk in the other side. I've got this open, I'm ready to go. This is my marketing account, so this is the one that's sending all the emails out. Again, I'm going to come to Automations and I'm going to fire the webhook. Sorry, I'm going to catch the webhook on this side. Let's go. This time I'm going to create a workflow. This workflow is going to be receiving the webhook.

When the webhook comes from the other side and saying they've opted in over there, do something. In this time, the trigger is the webhook. Let's do this. This is received, opt in, stop follow-up. Our trigger this time is an inbound webhook. So watch this. When the webhook is inbound, it gives me the URL that I need. Cool. Let's copy it and paste it over here. I'm sending it now. I've got my sender and my receiver. The method is POST, which means I'm posting something, think of it as Royal Mail, it's posting down the line, posting to that webhook. Now we're like, Okay, what's going on? What am I sending? What's the information that I'm sending? Now when that form is submitting, we're going to send across the information. I'm just trying to remember the header. The first thing you need to do is authorize. You need to authorize, I'm allowed to send this information. You have a header and the key is bearer. The value is your API key on the other side. Again, okay, I need to come over here and get my API key. I'm going to do it in the third tab just so I don't have to lose where I'm up to.

Again, I'm getting my mail account. There it is. I'm getting my API key. Now, guys, if you're not keeping up, that's okay. There it is, API key. Thank you. You can watch the replay over and over. There's also tutorials on how to do this in the help files of DHL as well. I need to Behrer. Sorry, I got that the wrong way. Authorization is the word there. Bearer with a capital B, space, API key. Authorization, space, authorization. The key is Behrer, space API key. Cool. That's now going to authorize when we send the information that says yes, you're allowed to send it. You're authorized, you have an API key. Cool. You're a welcome person here. Cool. That's our authorization. Now we need to send across the information. We've got contact ID, contact name, contact email, contact phone. This is what we need to actually send across to the other side to make sure it catches up. This is going to be contact. Name, just like that. And the value is from the form that's been submitted. Contact. Name, just like that. Send this name and match it on the other side to the name. Add another item, email.

You need either email or phone to identify within the system. Email value is going to be... Contact or email, but I'm going to grab it from here. Contact, email, just like that. Now this is going to send it across, but we also need something to happen on the other side, right? We need it to be able to say, Am I tagging them? Am I doing something? But at this point in time, we're just going to send the name and email across to the other side. So save. All right. When the form is submitted, send them to the other side. Now I need to test this so that the other side has a catch point. Let me see if I've got something here. These guys, I wonder if we've got an email, one test. On the other side, now I need to actually catch that information so that I can map it. Fetch, let's see. Did it send? There, not yet. Let's see if I've got it coming on. Sometimes does take a few minutes.

Does it need to be published even for testing?

No, it should be able to send in draft mode. Let me just make sure I've got... Yeah, I've got tons in here. That will do Stephen Sordello. Test workflow. Stephen Sordello. Did I spell it wrong? Stephen Sordello. Do that spell it wrong? Stephen Sordello. I'm going to find a contact to send this across on. That would do. Okay, so I'm sending this information on the web book. On the other side, I need to catch it. There it is, finally. Now I've sent a contact that had a name and an email which has been caught by the other side. I've said, Okay, great, show me. Now it's got all the details. There's the name, there's the email, phone numbers, et cetera. I've literally caught that one account has sent it and the other account has caught it. Okay, great. Now I have the information that's come across from the other side. Perfect. The next thing I must do is update a contact. Now what do I do? I say, Okay, make sure that the full name equals the full name that's come from the information here. The inbound webhook trigger is named, just like that. Make sure I've got the right one.

Inbound webhook trigger. Contact name. There it is. Now I've got it. The other thing is the email. Email comes from my trigger. Inbound webbook trigger, email. Just like that. Now one account has sent it, the other account has caught it. What do I need to do now? I need to tag or I need to stop an automation or I need to do something else. Now I'm going to come over here and create a tag. Add a contact tag. The tag is called opt in main account. Cool. That tag can then stop, remove, is the right word. Remove from a workflow, and that would be my cold email workflow. We're done. A little bit of a technical setup there, Ganesh. This is why I didn't do it because I was lazy. Took about 15 minutes to set that up. But let's again walk through what's happening. This is my main account, my primary account. This is where my contacts happen. This is where everything's supposed to happen. I've sent marketing emails and somebody's opted in into this account. In this account, they've opted in. What I've done when they do that is I send their information using a custom web hook back to the marketing account.

The marketing account catches that information using an inbound web hook as the trigger, catches that information and updates the contact with a tag that says action taken on the other side, remove them from the workflow as the follow-up. Okay? Ganesh, how are you feeling?

Oh, that's awesome.

Okay, I haven't lost you so far. Now, guys, the cool thing with GLL now releasing their own webhawks means that you can make this happen. Again, just having a look just purely for the recording, when we send the webhook, we need an authorization code. The header needs to have the word authorization. Then you say, bearer and your API key. Authorization, bearer, space, authorization, API key. And you want to send across the contact name and email so that it can be caught on the other side. If you get stuck here, the GL API docs, high-level API. High-level API. There we go. The high-level API docs, public-api. Com, gohighlevel. Com, we'll walk you through how to set that up. To do that, you go into post. We're talking about contacts, which is here. You can see contacts. Get contacts, post contacts. Post contacts will create a contact. You need to provide your location key, which is the bearer token. Again, it shows authorization, bearer, token. Your token is your API key. Guys, again, you can see it here. Header, authorization, bearer, space, API key, which is your token. The docs here are really very good. They're very, very detailed.

But in summary, we're marketing from one account, we're sending emails. How does that account know in the other account that something's happened? What we do is we set up that webhook connection. In the account where the things are happening, we fire that webhook. When something happens, when they make an appointment, when they book in, when they download, when they make contact with us in some point, we say, Cool, that action needs to send a web hook back to the other account, and the other account catches that web hook, takes that information and updates the contacts and says, Cool, something's happened over there. Stop the system over here. All right. Pretty technical. Hopefully that's okay, though, Kanesh.

That's fantastic. You saved me a lot of time.

Cool. Awesome.

Was this article helpful?

That’s Great!

Thank you for your feedback

Sorry! We couldn't be helpful

Thank you for your feedback

Let us know how can we improve this article!

Select atleast one of the reasons

Feedback sent

We appreciate your effort and will try to fix the article