APIs vs. Webhooks and Why it Matters for your Government Software

Written by Ben Sebree

Why APIs and Webhooks are the keys to your digital data strategy.
Free eBook: The Digital Transformation of Local Government

How is your data strategy keeping up with citizen expectations?

Download Now

When our civic engagement and municipal website experts are talking to local government leaders, we increasingly hear the same statement: We need a government content management system (CMS) that can integrate with existing software systems. This need for digital file sharing is the result of a trend that has been evolving for over a decade. Budget cuts and staff shortages are forcing governments to do more with less. Government administrators can no longer afford to spend time on duplicate data entry or managing multiple disparate systems that house siloed data. In an era of needing streamlined systems and digital workflows that maximize productivity, local governments need solutions that enable data sharing between critical software systems. APIs and webhooks are two pieces of technology that allow the types of integrations that local governments want and need, especially in the emerging era of content as service.

What is an API?

Application program interfaces (API) provide access to necessary business assets. From a technical perspective, an API enables programmatic access to application functionality. What this means to local governments with access to internal or outsourced technical expertise is that APIs can be leveraged to enhance existing software applications to fit their unique business processes either through creating custom experiences for end-users or by integrating systems that reduce the need for redundant tasks. In this way, APIs enable the sharing of data between separate software systems, facilitating interoperability, extending the power of existing software, and streamlining workflows.

An API is a software intermediary that allows two applications to communicate and share data. Think of an API as a waiter at a restaurant. It takes a request from a customer, delivers the request to a provider, and then carries the provider’s response back to the customer.

For example, if you wanted to integrate local weather information into your local government mobile app, how would you obtain the necessary weather data? While it is undoubtedly valuable local information, it is not proprietary to your municipality. Rather than hiring a staffer to maintain your community’s own meteorology office, you would be better served to integrate existing data from a known, reputable entity, such as the National Weather Service (NWS), into your app. Using an API, you could request weather data, just for your community, from NWS, and serve it up in your app, thus integrating the two systems for a seamless user experience.

eBook: Guide to Local Government Analytics

What is a Webhook?

Sometimes known as a reverse API, in the simplest terms possible, a webhook expedites the data sharing process. In an API call, a request takes place, and data is sent in response. With a webhook, there is no need to continually send a data request. Instead, data is pushed automatically, as soon as it is available.

In some cases, and going back to our weather example, you may want data to be continually sent from the provider to your system so that it is always current. In other cases, you may only need data to be transacted in specific scenarios. Such parameters that dictate the terms of your data sharing can be built into your webhook for ultimate control and flexibility. For example, if you are integrating your parks and rec software system's event calendar into your comprehensive local government website’s main community calendar, you may only want information to be transacted when a new parks and rec event or activity is added.

The CivicPlus Platform Integrated Solution for Local Governments

When to Use APIs and When to Use Webhooks

While APIs place calls regardless of whether or not response data is available, webhooks receive calls only when there are updates to be shared. Knowing when to use APIs and when to use webhooks will allow for the most efficient data transactions, and since greater efficiency means less labor-intensive set-up and maintenance, it is essential to choose the right piece of technology that is right-sized for the job.

Use APIs:

  • For instances where you can expect regularly changing data that will need to be served up at defined intervals. For example, perhaps you will only need to pull inmate records from your county’s prisoner database into a designated area of your municipal website on a daily basis.
  • When you have access to technical resources—whether internal or available from a partner resource—to help build and maintain connections and data sets.

Use webhooks:

  • When you want access to continually changing data that needs to be reported with up-to-the-second accuracy. For example, if you plan to send local alerts created using your government CMS to your digital road signage software, the second the data is pushed from your CMS, it needs to be available in the signage system.
  • For large data sets that could slow server speed and performance.

Leverage APIs and Webhooks When and Where You Need Them with CivicEngage®

The CivicEngage government CMS has been designed for ultimate data sharing flexibility. Our innovative consolidated data model has been developed to expose all content via API, but we also allow users to set up webhooks when appropriate. No matter your data sharing needs, CivicEngage has integrated solutions to help you work better, faster, with less.

If you're considering a local government website redesign, be sure to include software integrations in your planning. Download our Local Government Website Redesign Toolkit for everything else you need to know before your next website redesign.