If you’re a developer, you know all about APIs. However, if you’re in a non-technical role, you may not have the information you need to make educated decisions about the APIs your company offers and uses. In this article, we will take you through the API basics: what they are, how they work, why they’re important, and what you can do to protect your business’s reliance on API performance and uptime.
APIs and web services: What’s the difference?
You may have heard both terms: APIs and web services. They both seem to mean the same thing—to some extent, you’re right. But they are not quite the same thing. For our purposes here, an API (Application Program Interface) and a web service are the same things, but there is a difference. Skip to the next section if you’re happy with the “are the same thing” answer (no judgment here) or read on to learn about the subtle difference between the two.
What is a web service?
A web service is a communication standard that uses HTML (Hypertext Modeling Language), XML (Extensible Markup Language), WSDL (Web Services Description Language), SOAP (Simple Object Access Protocol), or REST (Representational State Transfer) to allow communication between devices on a local network or the Internet. Using web technologies, a web service facilitates communication between devices regardless of their operating systems. For example, a web service allows communication between an app on your mobile phone and a service on the Internet such as Facebook.
What is an API?
As stated earlier, a web service is a type of API. However, the broader term API applies to interfaces that allow applications to communicate on a network or on the same device. An API may use web service technologies, but it may also use any of several other communication methods such as COM+ (Component Object Model) to communicate between applications on the same machine. For example, many apps on your phone need to communicate with your phone’s GPS. An API allows the app to communicate with the GPS (provided you give it permission).
How do APIs work?
When an application on a device needs something the API offers, such as getting a list of available time slots on a reservation system, the application formats a request. The API takes in information using a known format such as JSON or XML that contains the parameters of the request. A parameter is textual information formatted in value pairs like “name” = “John Smith”. The API parses the value pairs and passes them to the internal application that makes the reservation. The API waits for the result produced by the reservation system and passes back the information to the requesting application (maybe an app on a handheld device). The app on the handheld device gives the user confirmation or asks for more information.
Who uses APIs?
We all rely on APIs every day without knowing it, and the devices and services we use need them to do their jobs as well. When it comes to your business, you use them a lot, and when they fail, your business feels the pain. Your company may already use tools that require the use of an API or offers the use of an API as an alternative way of interacting with your product.
Applications such as Slack publish APIs to allow you to integrate their messaging capabilities with other applications such as Uptrends’ Slack Integration.
Salesforce, MS Office 365, and Google Docs use APIs to retrieve and push data between devices.
Utilities such as virus protection and software and operating system updates use APIs to get the job done.
- Social media and Marketing
Facebook and Twitter and any other social media provider publish APIs.
That’s a short list. The links above take you to APIs that the services offer for apps to interact with their services. Uptrends has an extensive API many companies use to create, maintain, and get data from their monitors.
How do you protect the APIs you offer and use every day?
Like your website, the APIs essential to your business need watching for availability, performance, and function 24/7. At Uptrends, we have more than one way for you to protect your APIs.
Uptime is simply the percentage of uptime an API is available. The quickest and most straightforward way to check API availability is using Uptrends’ Webservice Monitors.
How does a Webservice Monitor work?
As often as every minute, one of Uptrends’ 200+ checkpoints sends a request to your API endpoint. Uptrends clocks the response and evaluates the result code. If the result code is unexpected or the speed, size, and content requirements don’t meet your expectations, Uptrends records the error. Uptrends then sends another request from another checkpoint. If the check fails again, Uptrends issues an alert letting you know.
How is API uptime calculated?
Uptrends’ tracks the time from the first confirmed error to the first successful response and uses the data to calculate your uptime percentage. You can monitor your availability using the SLA overview dashboard or your availability dashboards.
Web service monitors are great for tracking uptime, and they are a fantastic way to check the availability of the APIs you need for conducting your business. You can use them to watch your own Internet-facing APIs or the API providers you need every day. For example, you can use a web service monitor to check your merchant services provider’s availability without conducting a full transaction.
The faster an API responds, the better for all involved. Slow responses frustrate end-users and could be an indicator that there is a problem with your hardware, latency in the network, or configuration problems such as misconfigured DNS records.
An HTTPS Webservice monitor can evaluate the response time for a single request, such as an authentication request. However, performance may suffer on other calls that need to access other servers such as a product database.
Also, an HTTP/HTTPS Webservice monitor cannot respond to redirects or evaluate API communications that require multiple requests with data reuse. A Multi-Step API monitor is better suited for assessing performance on multi-request API interactions.
A Multi-Step API monitor allows you to build out requests and reuse returned data. With each request, you can set assertions to check that the response doesn’t surpass a maximum response time. With assertions, you can ensure every request in the chain gets a fast response.
Your check detail report breaks out your response time on a per-step basis while your logs and dashboards give you an average based on all the response times in a single check.
Performance and uptime are important; however, a fast and available API doesn’t matter if the API doesn’t work well. For example, if responses don’t include the correct data, your API fails. Using an HTTP/HTTPS Webservice Monitoring, you can check for response size, expected result codes, and content. However, you can’t make assertions on the content beyond making a basic text comparison on the response, nor can you reuse the content to set up other calls. With a Multi-Step API Monitor, you can capture functional errors that happen several steps beyond the first request.
Which API monitoring solution to use for what purpose
The API monitor type you use depends on the API and what you want to know about the interaction.
APIs such as merchant services must work all the time. If the service isn’t available, slow, or sending invalid responses, you need to know about it at once. You will want to use both API monitor types.
Uptime and SLA (Service Level Agreement) verification: Use HTTP/HTTPs Webservice Monitoring for uptime monitoring. A quick check every minute makes it easy to check for uptime and generate Uptime reports.
Performance and function: Use Multi-step API Monitoring to evaluate performance and function for complete API interactions. You get more comprehensive reporting, and by pairing HTTP/HTTPS Webservice monitors with your Multi-Step API monitors, you can schedule multi-step tests less frequently to reduce additional server load.
Moderate to light impact APIs
For non-critical API interactions, you need to decide how important the API is to your service or app and determine if you need a check. An inexpensive HTTP/HTTPS Webservice monitor can give you the information you need about availability, and for many cases, that is enough.
APIs you publish
If you publish an API, it is your responsibility to make sure your API is working for all your users all the time. Internal testing behind your firewall is not enough. You need to use a third-party service that can check your API from your users’ perspectives. Using Uptrends’ checkpoint network, Multi-Step API Monitoring allows you to see the entire picture of your users’ experiences. Multi-Step API Monitoring meters each request, evaluates response values using assertions, and reuses response data to build complex API interactions.
Web applications your business uses
We talked about these earlier. Tools like Salesforce, Office 365, and Uptrends all offer APIs that allow you to integrate these web applications into your internal systems. For example, you may integrate Salesforce data with your own internal systems. If the Salesforce’s API fails, your internal systems may fail too. Or perhaps, you use an API internally to provide services to your business locations worldwide; for example, Amazon may use APIs to maintain logistics across its many distribution centers.
Maintaining these connections with distributed systems presents its own challenges, so monitoring availability, performance, and function are critical to your business. API monitoring can check Internet-facing APIs from over 65 countries around the world on every continent. API Monitoring can keep you abreast of any lags in availability, performance, and operability.
Non-Internet facing APIs
Using Uptrends global network of checkpoints assures you that an API is accessible and working beyond your firewall. However, external monitoring can’t guarantee that your third-party and internal APIs work on your own network. To get the same protection internally that you get externally using Uptrends requires Private Checkpoints.
A Private Checkpoint is an Uptrends checkpoint that is physically on your network. A Private Checkpoint consists of four servers (virtual or actual) located at one central location or spread between various physical locations on your private network. The checkpoint is yours for your use only and maintained by Uptrends. With a Private Checkpoint, you can use all of Uptrends’ monitoring tools internally on your network, and you can verify if the third-party APIs you rely on work from behind your firewall.
Alternatives to API monitoring
API monitoring isn’t necessarily the best solution for verifying every API. For example, a Web Application Monitor may make more sense if the API is a cog in a bigger system such as a call to a merchant services API in a financial transaction. Because the transaction is part of the bigger system, you can use a Web Application Monitor to check the entire user interaction. Using a current Chrome browser, the monitor steps through your user journey just as your users do. If the interaction uses an API call, and that call causes an interaction to fail, you will know about it.
Bonus: Custom Metrics
Another benefit when using Multi-Step API Monitoring is the ability to track numeric values coming back from your API. You capture the value using a variable, and Uptrends makes it available to you in special dashboard tiles. Learn more about Custom Metrics.
APIs and API monitoring are big topics. APIs are bigger topics than we can fit into a single blog post. ProgramableWeb has a more in-depth article about APIs you may want to peruse to learn more about the technology. However, we hope you’ve gained enough information here to understand how important APIs are to your business and what you need to do to protect them.
We covered the available tools for protecting your APIs and keep an eye on those APIs you use in your daily work. Use HTTP/HTTPS Webservice Monitoring for basic uptime and SLA tracking, and Multi-Step API Monitoring for comprehensive performance and functional testing. You can test both performance and function from around the world with Uptrends 216+ checkpoint network and behind your firewall with Private Checkpoints.
- APIs facilitate the exchange of information across disparate systems and devices on the same device and across networks.
- Most anything you do on the Internet (apps or websites) use APIs for the exchange of data.
- Monitoring the APIs you rely on is necessary to keep your business operating smoothly.
- Using third-party API monitoring to check on and guarantee that your API is available and working well in compliance with your SLAs is your responsibility.
- Just because your API is working behind your firewall doesn’t guarantee that your API is working beyond it.
- Private Checkpoints can monitor your internal APIs on your local network and on the Internet
- You can try Uptrends’ API Monitoring free for 30-days (excluding Private Checkpoints).