Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                

Catchpoint1-API Monitoring Primer

Download as pdf or txt
Download as pdf or txt
You are on page 1of 13

Ebook

API Monitoring:
A Primer

TM

1
Introduction
As distributed systems evolved, so did the need for protocols Data sharing with APIs allows developers to make the most of today’s
that would act as a common platform for communication among technology; some of the everyday functions that depend on APIs
independent systems. The introduction of HTTP as the data include:
communication protocol underpinning the web paved the way for
processes that enabled disparate applications to talk to each other. • Making online payments via a payment gateway
Application Programming Interfaces or APIs provided the building • Booking a taxi based on your location
blocks for such processes. • Embedding social media platforms on your website to extend your
social media influence
The prolific growth of web and mobile applications was spurred by • Integrating widgets that display tweets or Facebook updates on
APIs, which allow seamless communication over HTTP. Network- your website
enabled devices are a new addition to the digital ecosystem and this
has given rise to a fresh host of web and mobile applications. Such APIs have helped build a well-connected digital world. This ebook
devices use APIs to function irrespective of the environment they are explains the basic concept of APIs, how they work, and why it is
installed in. important for IT organizations to monitor APIs.
1
What are APIs and Web Services?
An Application Programming Interface (API) is a set of rules or standards that extends the functionality of an application. It
defines the type of input requests the application can process (including parameters and data types) and the output that is
generated by the API requests. APIs allow different applications to connect and interact with each other.

Developers use APIs to create applications that act as middleware that communicates between different systems. Multiple
processes built using APIs, which allow data exchange and manipulation, are encapsulated into a “web service”. There are
different formats or specifications used when setting up web services, the common ones include Simple Object Access
Protocol (SOAP), Representative State Transfer (REST) and JavaScript Object Notation (JSON).

To understand the potential of APIs, take the example of a popular ecommerce site such as Amazon.com; Amazon
provides APIs to automate inventory management, order processing, and even track revenue growth. The APIs make
it easy for sellers, who list thousands of products on the site, to gain insight into their business using custom-built
dashboards and applications that handle everything from out-of-stock alerts to auto-updating tracking data for shipments.

How do they work?


The basic concept of a web API is data exchange over HTTP/HTTPS and involves two main components:

• Data Structure: The API requests and response use specific formats, either XML or JSON.
• Data Transfer and Security: The API exchanges/manipulates data using HTTP methods like PUT, POST, GET etc. These
requests/responses are processed based on the web service being used – SOAP or REST. HTTP headers, cookies, or
query string parameters are used to secure the data exchanged over web services.

SOAP, REST and JSON offer extensibility to APIs, making them compatible with other applications irrespective of the
language used. For example, Instagram and Facebook are two different social media platforms with functions that are
exclusive to their respective interfaces. Although these two applications are independent, both Instagram and Facebook
leverage APIs to allow interconnectivity. Hence, a user can log in to Instagram using their Facebook user account and share
photos on either platform.

2
Data transfer
Common data transfer methods include:

SOAP
SOAP is used to exchange information in XML format
over HTTP. It does not support any other data formats
and the requests/responses must be structured in
XML format. It supports SSL and error handling but is
generally slower than REST.

REST
REST is simpler and more flexible than SOAP. It allows
the use of different data formats including XML, JSON,
HTML or even plain text. REST, unlike SOAP, is not a
protocol. The data transfer works over HTTP as well
as SOAP. REST is preferred over SOAP because the
specifications are not as strict and because of the
range of data formats it works with.

4
Data structure
Common data structures used in web services include:

XML
Extensible Markup Language or XML is a customizable
markup language that is used to store and transfer
data. The data is enclosed within user-defined tags and
follows a parent-child node structure.

JSON
JSON transfers data objects in the form of attribute-
value pairs. It is less verbose than XML and the data
is structured in an array while XML is structured in a
tree format. JSON is generally preferred over XML as its
structure makes it easier to parse.

5
Why use APIs?
APIs extend the functionality of web applications and drive automation. Developers take advantage of the interoperability
of APIs to build modules that communicate seamlessly irrespective of the system’s configuration. This provides endless
possibilities to innovate and make a positive impact on user experience.

The Internet of Things (IoT) is an example of the huge impact APIs have had on the Internet landscape. IoT is powered
by APIs. The proliferation of mobile devices has encouraged the concept of “smart” and connected devices. APIs connect
otherwise ordinary devices such as household appliances, cars, and smartphones to cloud-based services that control and
dictate the functionality of IoT devices.

APIs have become an indispensable part of the digital world. Modern web applications use APIs to enable numerous
functions that would have been otherwise impossible. For example:

• Integrating payment gateways with ecommerce platforms


• Integrating social media apps like Facebook, Twitter, Instagram etc. with websites
• Integrating analytics tools to track website performance and revenue growth
• Integrating additional functionality such as advanced search, affiliate programs and advertising
• Integrating tools like Salesforce, Slack etc. to manage and track productivity within the organization
• Integrating IoT devices

EXTEND CUSTOMER REACH INCREASE REVENUE INNOVATE

THIRD-PARTY SERVICES API WEB & MOBILE APPLICATIONS


5
Is API monitoring important?
Every web application relies on APIs to integrate third-party services and extend user functionality. The performance of the
API integration has a direct impact on the user’s digital experience. To understand the issues that can be caused by APIs that
are not implemented correctly, consider the following scenarios:

Take the example of an ecommerce site. When a user places an order on the website, the payment gateway
uses APIs to verify the user’s credit card data. If the API that integrates the payment options on your site is
broken, then not only does this result in an abandoned cart, it also adds to user frustration resulting in a
negative user experience.

X
Let us consider a third-party search widget as another example. If the API that runs the search functionality
is broken, then users will be unable to find the product they are looking for. This causes user frustration and
impacts business.

If you use APIs to automate inventory management, then an issue with the API performance can cause
delays in order fulfillment that cascades down to all stages of order processing impacting your online store
revenue.

The number of API calls are higher in IoT devices as they rely on real-time data updates, so any latency can
hinder performance.
6
It is important to understand the significance of API performance. Not having a monitoring strategy in place for your APIs
can prove detrimental to your business and online presence. Monitoring API performance is not limited to just checking
availability, it provides a snapshot of the overall API health and helps you answer these critical questions:

• Is the API running successfully?


• Are the API calls returning the right results?
• Is there any performance degradation?

What does API monitoring involve?


API monitoring tools keep track of crucial processes – both backend (database impacting) and frontend (end-user impacting).
We can break down what is involved in API monitoring into the following:

• Monitoring service uptime/downtime (availability)


• Monitoring multi-step transactions
• Validating the data returned and handling errors
• Measuring response times
• Triggering alerts when API generates errors
• Evaluating performance from different perspectives – developers, testers, and DevOps

7
Using Catchpoint to monitor APIs
Since APIs run core processes in web and mobile applications, they should be one of the major focus points when
analyzing performance. If your business relies on API integrations or you allow customers to access their data via an API,
you will need a monitoring solution that gives a 360-degree perspective of the processes that make up the application. If
you are evaluating a monitoring tool, consider the following question:

• Is the monitoring tool triggering alerts?


• Does it alert to performance degradation?
• Does it alert SLA breaches?
• Is root cause analysis possible?

Catchpoint allows you to monitor APIs using


the API test. The test can be set up to monitor
availability issues and the data collected over
time can be used to analyze performance trends.
You can also test if the APIs are functioning
correctly by validating the inputs and ensuring
the data is structured in the right format.

The image to the right shows a sample API test


in Catchpoint. The script has been coded for a
hotel booking application. The test emulates
typical user behavior on the website; first it logs
into the site using a pre-configured account and
looks up hotel availability based on the specified
search criteria. Once the script completes these
two steps, it logs out of the website. An alert is
triggered if the script generates an error. Monitoring the API using such scripts allows you to track the API functionality and
availability easily.

8
Integrating Catchpoint APIs
While companies rely on Catchpoint to monitor their APIs, Catchpoint also offers multiple API services. Our customers
use Catchpoint APIs to integrate Catchpoint data with their internal systems/applications. We offer three types of API
integrations:

Test Data Webhook – The Test Data Webhook sends the test results to an endpoint specified by the client. This makes use
of webhooks and the data is pushed to the endpoint in XML or JSON format using a POST request.

The data can be used by the client to display in a custom dashboard or integrate with third-party tools such as Splunk or
Datadog. The client can also store this data locally in their own server.

Alerts Webhook – This API is like the Test Data Webhook but instead of pushing every test result, the API will only push data
when an alert is generated. The data can be sent in XML, JSON or text format. An additional feature is the ability to create
templates for the data that is generated.

9
REST API – This API allows the client to make a data request for specific tests using REST. The data is secured using OAuth 2.0
and supports POST and GET methods. The API can be used to edit tests or to export test results.

The data response from these API calls can be used in custom dashboards and reports.

What are webhooks?


Webhooks are HTTP callbacks that are triggered by events specified in the code by the
application developer; the event data is then recorded and pushed to an end-point URL.
For example, when you subscribe to the newsletter feature on a website it triggers a
webhook defined by the website developer. This webhook sends the user data to the third-
party mailing service that is integrated with the website. The mailing service accepts the
new user data and triggers a response email that is sent to the subscriber immediately.

10
Summary
APIs provide extensibility to existing services and play an
important role in the growth of online services. They have
enabled hundreds of independent applications to talk to
each other and have driven innovations, powering IoT and
mobile apps. Popular apps like Instagram, Twitter, Yelp, and
Uber rely heavily on APIs to provide their services.

The complexity of the API landscape demands a solution


that can monitor applications that use third-party APIs
as well as services that provide APIs. The monitoring tool
must be able to break-down the performance issues to
understand the root cause and trigger alerts to warn the
client about performance degradation or availability issues.
Catchpoint API monitoring helps you evaluate end-user
experience based on the API performance and ensure that
the API integration on your site is functional and available to
your users from any part of the globe.

11
A Different Approach
to Digital Experience
Monitoring
Catchpoint is a leading digital experience intelligence
company that provides unparalleled insight into your
customer-critical services to help you consistently deliver 16 Smart Monitors
amazing digital experiences. Catchpoint is the only Real browser, multi-transaction, mobile, HTML code, API,
performance digital experience monitoring platform that streaming, DNS, FTP, TCP, SMTP, ping, traceroute, SSH,
provides integrated synthetic and real user monitoring, NTP, IMAP and web socket
comprehensive test types, real-time analytics, and a
diverse node network to help you continuously preempt Deepest and broadest diagnostics: 100 days of object level
data; 3 years of raw aggregate data.
performance issues and optimize service delivery. More
than 400 customers in over 30 countries trust Catchpoint
to strengthen their brands and grow their businesses.

To request a free trial, visit


www.catchpoint.com/freetrial.

TM

13

You might also like