Webhooks: Connecting SuperSaaS to other websites
Webhooks are user-defined callbacks that inform other applications or websites about events happening on your SuperSaaS account in near real-time.
A few examples of how you can use a webhook:
![Webhooks logos](http://static.supersaas.net/img/webhooks/webhooks_logos03.png)
- When a new user signs up on your SuperSaaS account subscribe him to a MailChimp mailing list
- When a new user signs up send a PDF with your terms and conditions to his email address
- When a new appointment is made generate an invoice in QuickBooks or Freshbooks
- When a new appointment is made for a specific class, mark the Google Calendar of the teacher of that class
- When an appointment is about to start send a notification to Slack or push a notification to your phone
- When a user gets moved from a waiting list to a confirmed place send him an SMS message
- When an email is sent divert it to send email via another mail server
Automatically configure webhooks using Zapier.com or Make
You can use either Zapier.com or Make to interactively create links between hundreds of well-known websites and SuperSaaS, without the need for programming. Both Zapier and Make offer a trial version and a free tier for small users.
It should be relatively straightforward to create webhooks from the pre-made examples, but you can find detailed information below if you want more control by filtering only certain events.
![New client to MailChimp](http://static.supersaas.net/img/webhooks/ss_mailchimp.png)
![New appointment to Google Calendar](http://static.supersaas.net/img/webhooks/ss_googlecal.png)
![New appointment to QuickBooks](http://static.supersaas.net/img/webhooks/ss_quickbooks.png)
![New appointment to Mail](http://static.supersaas.net/img/webhooks/ss_mail.png)
Supported Triggers
There are several events that you can monitor. Some events can be monitored either for a “new” event, or a “changed” event. The “changed” event includes every change, so it also fires on “new” and “delete”. So if you configure both a “New user” and a “Changed user” then both hooks will fire when a new user signs up. Note that if you’ve configured your schedule to not require signup then you would never see a “New user” trigger, only a “New appointment” trigger.
Trigger | Caused by… |
---|---|
New user | Fires when a user registers for your account |
Changed user | Fires when the user updates his registration information, or the administrator does it for him. |
New appointment | Fires when a user, or the admin, makes an appointment on the specified schedule. |
Changed appointment | Fires on all possible changes to an appointment, including “New”, “Delete”, “Placement from waiting list”, “Payment received”, etc. (See the full list below) |
New stand-alone form | Fires when a stand-alone form is filled out. Note that it does not trigger when a form is attached to an appointment, instead that would trigger the appointment webhook. |
Updated stand-alone form | Fires upon any change to a stand-alone form (integrated forms would trigger a “Changed appointment” or “Changed user”) |
Send mail | Fires on all emails sent from your account, including “Lost password” mails etc. Useful to send mail through your own server. Email will no longer be sent by us if this webhook is active. |
Reminder Follow-up | Fires on Reminders or Follow-ups. The reminder or follow-up will no longer be sent by us if its webhook is active. |
Purchase | Fires when a user buys something in your shop. Also fires if you create a purchase manually. |
Filtering events
When you connect two services using Zapier or Make it allows you to filter the events. Some examples of how you can use filters:
- Only send an SMS notification when someone is placed from a waiting list, not for every appointment change
- Only notify a teacher of a new booking if the class is taught by that teacher, ignore other bookings on the same schedule
- Only send a notification to management if the booking has a value of more than $100
When you create a new webhook, Zapier/Make will request an example object from SuperSaaS. The example object lists the available fields and some example content. The fields that the webhook sends are dependent on which fields are enabled in your account and whether a custom form is attached. There are “event” and “role” fields included with most triggers which can be used to filter the events. For example, you could filter only triggers that contain the value “delete” in the field “event”.
Trigger | Possible values of the “event” field |
---|---|
New user | new |
Changed user | new, change, delete |
New appointment | create |
Changed appointment | create, edit, place, pending, destroy, restore, approve, revert |
New form | new |
Changed form | new, change, delete, restore |
Reminder / Follow-up | reminder, follow_up |
Purchase | purchase |
“Role” field | Who triggered the event… | |
---|---|---|
0 | Anonymous | Not logged in |
1 | Logged in with a shared password | |
2 | Validated using an IP range check | |
3 | Regular user | |
4 | Superuser | |
5 | Administrator or Reseller | |
7 | System or Payment gateway |
When creating or changing an appointment that includes payment, the field “status” and “status message” allow you to narrow down to specific events using the list of all possible status codes. For example, you could set a filter to only act on messages for appointments that have been refunded.
Manually configuring webhooks (advanced)
Creating a webhook without the use of Zapier or Make requires some web development skills. You can adjust webhooks to send them directly to your own server, or to modify the payload they contain. The details can be found in the developer webhook documentation.