Push vs. Pull API

Also known as: Webhooks vs. Polling, Pinging

Applications can read data from and to other applications via their API, but there are two ways to do that.

Why almost all apps have APIs

Many organizations are working on creating or improving their Digital Workplace and as such are concerned with picking applications based on how open and accessible their APIs are. Over the years this has led to APIs becoming more or less commonplace with all software companies, especially SaaS apps.

Pull API

Also known as: Polling, the old way

Most often, if an app offers an API than it's considered to be a Pull API. Pull APIs

As the developer you can poll the API anytime and you get back whatever the results are right at this instant.

If you want to create an application using this API's data, you will need to figure out a way to continuously poll the API so you never show outdated data to the user.

Polling an API is a little like refreshing your inbox every 10 seconds and seeing if anything new has come in. Obviously this is an expensive operation and completely wasted 98% of the time.

Editor's tip
If you're looking for a free way to continuously poll an API, get the free Digital Assistant tool which lets you connect any API via Postman.

Push API

Also known as: Webhooks, RESThook, the new way

A much more efficient way to monitor for updates is to reverse the roles and have the source application send out an update when it has something new.

That's what webhooks do: A webhook is a specific URL your application gives to another application with the request to send to it whenever something new has happened. All your application than has to do, is monitor it's own URL which is much less resource-intensive and nearly instantaneous.

New Webhooks can now trigger notifications in your Digital Assistant app. Set up now

Diagram illustrating the difference in nature of polling for data (multiple periodic requests from service A to service B) vs webhooks (service B sending information to service A when it's ready)
Comparison between polling and webhooks

Even faster: WebSockets

Modern browser also support what is called TCP/IP WebSockets which allow servers to push data directly to the browser.

The WebSocket protocol is utilizing a close relative of the HTTP protocol that allows browsers to receive websites from a server. But with WebSockets the server and client can actually execute a handshake in order to start an open and permanent channel through which they can exchange WebSocket "envelopes".

This enables the server to push updates towards the clients asynchronously: The client is basically letting the server know what types of information it would like delivered and the server then sends back 'envelopes' in relative real-time.

While incredibly fast, this technology is mostly used for communication within the client and server of the same application, not for external / 3rd party consumption of data.