Webhooks for SaaS Integrations – What are Webhook integrations and how can you implement it.

What are Webhooks?

Webhooks are automated alerts that are sent when there is a change of any type on a platform. Think of it like an sms notification you receive when there is a change on a specific app.

We'll take an example of Quickbooks to explain this. The use case is that your users' connect their accounts and your SaaS helps manage Customers added in Quickbooks. Without a webhook, what one would do in this case is poll the Quickbooks API at regular intervals to check if any new Customers that have been added or changed.

The problem with this approach:

  • Too much load on Quickbooks Infrastructure to respond to your API poll
  • Too much load on your own SaaS infrastructure to poll for all your tenants
  • Data Syncronization architecture has to be built in to check for addition and updates to Customers. Depending on the size of data that is being synced, this task can be huge
  • Since we are discussing this in the SaaS context, the processes have to be run for every connected user of your account.

The overhead of resources needed to address this is quite large and the quality of the solution is not equally optimized across different architecture styles.

Webhooks are a more elegant and efficient replacement for Polling.

Quickbooks, in this case, would notify a designated URL if there are any changes. So we can pack up all the implementation involved with the polling architecture, and store it in the attic. You are essentially acting Just In Time.

SaaS Glossary

Tenant - A User/Account of your SaaS software. AKA: End User/SaaS User

OAuth App - The app you created in the Quickbooks which allows you to capture user authorization to access their data

Provider - Quickbooks or equivalent

Webhooks Glossary

Callback URL: A url that Quickbooks or any other SaaS app will notify. Also known as Webhook URL/Designated URL/ Webhook Endpoint

Webhook Event: An event that will be monitored and will cause a post to the Callback URL

Webhook Data: The data schema that will be sent to the Callback URL on the Webhook Event

Callback Method: The HTTP method (usually POST) that will be used to execute the callback

Webhook Handler: The server app that honors the receipt at the Callback URL and does further processing. e.g. Bubble backend API, Pathfix Automations, any SaaS automation software

Webhooks vs. Webhooks for SaaS (WebhooksS)

In principle both do the same thing. But as a SaaS builder your application manages webhooks, not for yourself, but for all your users' accounts. Here we introduce an additional Webhook Glossary Item.

Webhook Tenant: The account for which the webhook was recieved.

Building out an architecture for (WebhooksS)

The following steps list what should be happening

  1. Tenant Authorises - The starting point where your tenant (EndUser) gives you authorization to access their data. Usually done through OAuth
  2. Webhook Activation - You server starts listening for any notifications from Quickbooks on behalf of the Tenant
  3. Webhook Event - Your server gets notified about the webhook event
  4. Webhook Tenant - Since the webhook url is common for your registered OAuth App, you have to derive who the webhook is for based on the Webhook Data that has come in. A further process might need you to query Quickbooks API. Sending the correct API Authentication (use Pathfix OAuth) is possible now. The Tenant identifier here will always match with the Tenant that authorized in step 1.
  5. Act - This is the final step where you now know the Webhhook Event, Webhook Tenant and have Webhook Data. All the information you need to complete your custom SaaS integration.

Step 4 is the key distinguisher here.

Does Pathfix Automations(PA) Solve Step 4.?

Yes. Pathfix Automation leverages the power of it's OAuth architecture to store some additional information during "Step 2. Webhook Activation". This allows us to use the information available in the Webhook Data to derive the Webhook Tenant.

Once we have derived the Webhook Tenant, we then relay the Webhook Data along with the Webhook Tenant to a Callback Url that you can specify in Pathfix Automation's Webhook configuration for the Provider.

Conclusion

Webhooks are a fantastic means for you to be able to sync data between your platform and any 3rd party application.

If you are ready to build out your integrations, check out the Pathfix platforms for your specific needs:

Need help with your integrations? Reach out to us and we will be happy to set this up for you.

Start Your Build With Pathfix OAuth