In this age of cloud computing and SaaS applications, we hear a lot about Application Programming Interfaces (APIs) and how they can let us connect any application to any other application. Finally, we’re told, everything in the whole world can work as one.
We also hear a lot about webhooks and even how we can use Zapier for any system-to-system integration using APIs, or web services and webhooks.
What are APIs, Web Services and Webhooks?
In fact, they are all the same thing. An API is a fancy name given to a collection of web services or webhooks that performs a specific function whenever someone or some other application calls on it. It allows inbound data to be received or outbound data to be sent.
Web services and webhooks are the same things (but the reason why web service is two words while webhook is only one is another mystery of the techno world lingo!) In simple terms, they are URLs much like a web page.
But unlike web pages, they do not display an HTML page in your browser. APIs carry data from one system to another, so the receiving application can store or process the data.
For example, think of a CRM system that tracks client data, such as name, phone, and address. Unfortunately, the client’s CRM system doesn’t have automated email capabilities. But what if you want to send an automated email to your team whenever you add a new contact to the CRM, to give them the info about the new contact? You’d have to manually compose and send an email every single time a new contact is added.
But with APIs, you can automate the process. You can create a simple API that allows you to send emails.
For example, if your email system has an API, you’d have a URL—something like https://myemail.com/sendemail—that you can send along with the new contact person’s name. For example, you could enter: https://myemail.com/sendemail?name=John Doe&phone=123-555-5555&address=123 Main Street, Chicago, IL, USA
This URL also called an endpoint, is an application that uses the parameters to send out emails to a pre-specified email address.
But what if we want to take it a step further and trigger this automatically whenever a new contact is created in our CRM system? We need a “hook” into the application so that whenever we add a contact and click SAVE, it calls our web service with the data. Of course, the CRM system must be able to provide us with that webhook capability. Many applications have implemented lots of webhooks. Here are examples of web services and webhooks for some systems:
With PayPal, we can call a web service to process a payment and another web service to process a refund. In this case, we would be calling their endpoints. For example https://paypal/processpayment?paymentdata…
Also, PayPal’s webhooks can be configured to call us when a payment has been made, when it has been rejected, or when it has landed in a bank account. In this case, PayPal is the one calling an endpoint. For example https://mycompany/paymentprocessed?data…
With MailChimp, you can create an email campaign using an API and then add the emails that you want the email campaign to be sent to. When a campaign is active and running, each time someone receives the email campaign, you can set up a webhook to send you the email address of the person that received it, inform you if they opened the email, etc.
What the URLs do once they are executed will depend on what they were initially programmed to do. Some endpoints are written to receive some data and store it somewhere. Others are meant to do something. For example, with an Amazon Dash Button, the user presses it and all it does is send a signal to an Amazon endpoint that states “Buy this article.” It is a trigger for a series of other actions.
If you click the Add to Cart button on Amazon, the endpoint that is called expects a lot more data, such as what products were selected and the quantity purchased.
Now you see how APIs are collections of URLs that allow for inbound data to be received (web service endpoints) or outbound data to be sent (webhooks). The data that is sent can either specify what action to perform or it can be data that needs to be stored.
What about ClicData?
ClicData does not have webhooks. So, when you add a new user to an account, create a new dashboard or load data, the application will not call an external URL with some parameters.
ClicData does use web services APIs that allow many different types of actions to be automated. These APIs can be called by other applications’ webhooks or they can be called whenever a user presses a button on that external application.
ClicData implements several types of APIs that are used to:
- Trigger an event, for example, “Start this schedule”
- Obtain data from the ClicData application. Example: “Give me a list of all my dashboards”
- Send real-time data directly to any tables in the ClicData platform
These types of APIs have a specific structure and require data to be passed along in a specific manner.
In WooCommerce, for example, you can add a webhook to a certain action, such as each time someone adds a product to the shopping cart. The webhook would be https://docs.woocommerce.com/document/webhooks/ and the event type woocommerce_add_to_cart
.
This specific webhook expects that the URL will accept some data in a specific format since it will send certain information along with the URL, such as the product that was added to the cart, the name, the SKU, etc.
But the way that WooCommerce sends the data is not compatible with the structure of our API and the way it receives data.
Because every application develops their webhooks differently and the way that data is sent, and in what order, differs, ClicData doesn’t yet have a generic way to accept a generic webhook call unless the calling application is able to customize how the data is set.
But…
ZAPIER to the Rescue
With Zapier, you can translate the content of webhooks sent by WooCommerce into a different format. Currently, in Zapier, we can only trigger data refreshes but our next Zapier “Zap” is actually adding/inserting rows of data.
The Future…
It is possible that in the future ClicData will be able to listen to webhooks coming in and decode their data in a variety of ways in order to store it in a table. But until then, further work needs to be done with tools like Zapier.
Learn more about ClicData & Zapier