APIs For Dummies - IBM Limited Edition PDF
APIs For Dummies - IBM Limited Edition PDF
APIs For Dummies - IBM Limited Edition PDF
by Claus T. Jensen
These materials are 2015 John Wiley & Sons, Inc. Any dissemination, distribution, or unauthorized use is strictly prohibited.
APIs For Dummies, IBM Limited Edition
Published by
John Wiley & Sons, Inc.
111 River St.
Hoboken, NJ 07030-5774
www.wiley.com
Copyright 2015 by John Wiley & Sons, Inc.
No part of this publication may be reproduced, stored in a retrieval system or transmitted in any
form or by any means, electronic, mechanical, photocopying, recording, scanning or otherwise,
except as permitted under Sections 107 or 108 of the 1976 United States Copyright Act, without the
prior written permission of the Publisher. Requests to the Publisher for permission should be
addressed to the Permissions Department, John Wiley & Sons, Inc., 111 River Street, Hoboken, NJ
07030, (201) 748-6011, fax (201) 748-6008, or online at http://www.wiley.com/go/permissions.
Trademarks: Wiley, For Dummies, the Dummies Man logo, The Dummies Way, Dummies.com, Making
Everything Easier, and related trade dress are trademarks or registered trademarks of John Wiley &
Sons, Inc. and/or its affiliates in the United States and other countries, and may not be used without
written permission. IBM and the IBM logo are registered trademarks of International Business
Machines Corporation. All other trademarks are the property of their respective owners. John Wiley
& Sons, Inc., is not associated with any product or vendor mentioned in this book.
For general information on our other products and services, or how to create a custom For Dummies
book for your business or organization, please contact our Business Development Department in the
U.S. at 877-409-4177, contact info@dummies.biz, or visit www.wiley.com/go/custompub. For
information about licensing the For Dummies brand for products or services, contact
BrandedRights&Licenses@Wiley.com.
ISBN: 978-1-119-04116-0 (pbk); ISBN: 978-1-119-04117-7 (ebk)
Manufactured in the United States of America
10 9 8 7 6 5 4 3 2 1
Publishers Acknowledgments
Some of the people who helped bring this book to market include the following:
Project Editor: Carrie A. Johnson Business Development Representative:
Development Editor: Kathy Simpson Sue Blessing
Editorial Manager: Rev Mengle Production Coordinator: Melissa Cossell
These materials are 2015 John Wiley & Sons, Inc. Any dissemination, distribution, or unauthorized use is strictly prohibited.
Table of Contents
Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
About This Book......................................................................... 1
Icons Used inThis Book............................................................. 2
Beyond theBook......................................................................... 3
These materials are 2015 John Wiley & Sons, Inc. Any dissemination, distribution, or unauthorized use is strictly prohibited.
iv APIs For Dummies, IBM Limited Edition
These materials are 2015 John Wiley & Sons, Inc. Any dissemination, distribution, or unauthorized use is strictly prohibited.
Introduction
A PIs are a hot topic, energetically debated by business-
people, IT managers, and developers alike. Most of the
excitement in the public space is about open public APIs. To
some degree, not having a public API today is like not having
a website in the late 1990s. Yet for many enterprises, public
APIs are really the least of their business concerns. More
important concerns include building omnichannel solutions,
innovating faster than the competition, becoming a mobile
enterprise, or operating in a hybrid cloud environment.
These materials are 2015 John Wiley & Sons, Inc. Any dissemination, distribution, or unauthorized use is strictly prohibited.
2 APIs For Dummies, IBM Limited Edition
Take care when you see the Warning icon, which alerts you to
things that could harm your business.
These materials are 2015 John Wiley & Sons, Inc. Any dissemination, distribution, or unauthorized use is strictly prohibited.
Introduction 3
Beyond theBook
This short publication cant offer every detail about a topic.
So for more information outside the realm of this book, check
out the following links:
These materials are 2015 John Wiley & Sons, Inc. Any dissemination, distribution, or unauthorized use is strictly prohibited.
4 APIs For Dummies, IBM Limited Edition
These materials are 2015 John Wiley & Sons, Inc. Any dissemination, distribution, or unauthorized use is strictly prohibited.
Chapter 1
These materials are 2015 John Wiley & Sons, Inc. Any dissemination, distribution, or unauthorized use is strictly prohibited.
6 APIs For Dummies, IBM Limited Edition
The Twitter APIs, for example, easily have ten times more traf-
fic than the Twitter website does. The companys business
model deliberately focuses on tweet mediation, letting anyone
who wants to do so provide the end-user experience.
These materials are 2015 John Wiley & Sons, Inc. Any dissemination, distribution, or unauthorized use is strictly prohibited.
Chapter 1: The Anatomy of an API 7
From the get-go, Amazon chose to be not just an Internet
retailer, but also a ubiquitous merchant portal. Amazons mer-
chant platform is deliberately built on APIs that allow easy
onboarding of new merchants.
Some people use the term business APIs for all modern APIs.
The term is certainly fitting in the sense that APIs, as prod-
ucts, should be an integral part of your business strategy.
Just be aware that launching a public or partner API isnt the
only way to make APIs part of your business model. There are
many use cases for internally consumed APIs, perhaps the
most common such use case being the need to provide a dif-
ferentiating omnichannel customer experience.
Understanding What
DevelopersWant
Developers want to use APIs for innovation and experimenta-
tion. To them, reuse is about speeding time to delivery, shar-
ing is about expediency, and encapsulation is about having
little to learn. Theyre not as interested in how APIs were cre-
ated (and at what cost) as they are in how easy the APIs are to
consume.
These materials are 2015 John Wiley & Sons, Inc. Any dissemination, distribution, or unauthorized use is strictly prohibited.
8 APIs For Dummies, IBM Limited Edition
These materials are 2015 John Wiley & Sons, Inc. Any dissemination, distribution, or unauthorized use is strictly prohibited.
Chapter 1: The Anatomy of an API 9
These materials are 2015 John Wiley & Sons, Inc. Any dissemination, distribution, or unauthorized use is strictly prohibited.
10 APIs For Dummies, IBM Limited Edition
These materials are 2015 John Wiley & Sons, Inc. Any dissemination, distribution, or unauthorized use is strictly prohibited.
Chapter 2
These materials are 2015 John Wiley & Sons, Inc. Any dissemination, distribution, or unauthorized use is strictly prohibited.
12 APIs For Dummies, IBM Limited Edition
Figure2-1: M
anaging APIs requires more than API design and
externalization.
These materials are 2015 John Wiley & Sons, Inc. Any dissemination, distribution, or unauthorized use is strictly prohibited.
Chapter 2: Managing APIsAnd Not 13
IT operations
IT operations must ensure certain operational characteristics, all
of which can also be done without changing the API definition or
implementation in any way. These characteristics are as follows:
For more about IT operations role, see The Need for API
Governance later in this chapter.
API designer
The person that holds the API designer role physically creates
and deploys the API. She needs to do the following:
These materials are 2015 John Wiley & Sons, Inc. Any dissemination, distribution, or unauthorized use is strictly prohibited.
14 APIs For Dummies, IBM Limited Edition
These materials are 2015 John Wiley & Sons, Inc. Any dissemination, distribution, or unauthorized use is strictly prohibited.
Chapter 2: Managing APIsAnd Not 15
(remember, good API implementations are configurations, not
code). Business and IT decisions are both part of good API
management discipline and should be supported by the chosen
API platform. (For more about API middleware, see Chapter5.)
What is the payment model for using the API and is that
acceptable for your purpose?
Will you need a corporate proxy in front of the API to
handle licenses, payment, and the like, or will every
developer register independently?
Is the API secure and reliable for mission-critical purposes?
Any historical records about how the API has behaved
over time may add to consumer confidence in using it.
When the APIs being consumed are your own, these decisions
are pretty straightforward, being mainly about overall busi-
ness design. When the APIs are third-party APIs, the decisions
become more complicated. Ultimately, the end-user experi-
ence and responsibility for maintaining business integrity
cant be delegated. You need someone in your own organiza-
tion to be responsible for the end-user experience and to
make the right decisions about which APIs its appropriate to
consume as part of your delivery model.
These materials are 2015 John Wiley & Sons, Inc. Any dissemination, distribution, or unauthorized use is strictly prohibited.
16 APIs For Dummies, IBM Limited Edition
These materials are 2015 John Wiley & Sons, Inc. Any dissemination, distribution, or unauthorized use is strictly prohibited.
Chapter 3
These materials are 2015 John Wiley & Sons, Inc. Any dissemination, distribution, or unauthorized use is strictly prohibited.
18 APIs For Dummies, IBM Limited Edition
Figure3-1: R
ace cars and APIs should be built to the same design
principles.
These materials are 2015 John Wiley & Sons, Inc. Any dissemination, distribution, or unauthorized use is strictly prohibited.
Chapter 3: Discovering the Nature of Good APIs 19
This situation makes the case for opportunistic APIsrapidly
created, rapidly changing APIs defined to meet a specific con-
sumer need. For more information about the developer point
of view, see Chapter1.
These materials are 2015 John Wiley & Sons, Inc. Any dissemination, distribution, or unauthorized use is strictly prohibited.
20 APIs For Dummies, IBM Limited Edition
APIs versusservices
The core concept of SOA is the notion of a service. The Open
Group, for example, defines a service as a logical representa-
tion of a repeatable activity that has a specified outcome.
Services are self-contained and opaque to their consumers,
and they have well-defined interaction contracts. From a tech-
nical perspective, these characteristics also apply to any well-
designed API, so technically, an API is also a service.
In that case, are APIs just another name for services? Well,
theres one important difference between services and
APIs, however, and thats the goal behind their design (see
Figure3-2). APIs are always designed to be attractive to the
intended consumer, and they change as the needs of the con-
sumer change. Services, in contrast, are generally designed
with global cost and stability as the most important concerns.
In the car analogy, the API is the race car designed for looks
and consumption, but the service is the regular car designed
for cost and mass production.
Figure3-2: A
PIs and services address different concerns.
These materials are 2015 John Wiley & Sons, Inc. Any dissemination, distribution, or unauthorized use is strictly prohibited.
Chapter 3: Discovering the Nature of Good APIs 21
are the fundamental differences between APIs and the classi-
cal notion of services, at least different from the perspective
of the service provider:
How often have you not seen an SOA initiative slowed down
by conflicts between service providers and service consum-
ers on what constitutes a good service interface? On the one
side, a mobile developer just wants it to be simple for her par-
ticular app. On the other side, the back-end team wants every-
one to use the same standardized service and data model.
Instead of forcing a resolution of this conflict, is there a way to
meet both needs without incurring prohibitive cost?
These materials are 2015 John Wiley & Sons, Inc. Any dissemination, distribution, or unauthorized use is strictly prohibited.
22 APIs For Dummies, IBM Limited Edition
Not all APIs are REST. Generally, REST interfaces are excellent
for human consumption, and they are the current preference
of mobile developers. But REST interfaces tend to be chatty,
and though theyre extendable, they dont carry strongly
These materials are 2015 John Wiley & Sons, Inc. Any dissemination, distribution, or unauthorized use is strictly prohibited.
Chapter 3: Discovering the Nature of Good APIs 23
typed complex data structures. SOAP interfaces are great for
system-to-system integration, and IT operations teams prefer
them due to their less chatty nature and more precise data
structures. MQTT interfaces are preferred for communicating
with the Internet of Things, in which bandwidth and battery
life are key concerns, and guaranteed delivery may be the dif-
ference between preventing accidents and inadvertently let-
ting them happen.
Unfortunately most of the examples The reason being that it says nothing
discussed in the industry at large are about the different types of business
exclusively around public APIs, and objectives that may have led you
this is by far not the only use case to consider APIs in the first place.
for APIs. Even more unfortunately, Chapter 4 addresses that concep-
the generic value chain picture is tual gap by defining the typical API
uninteresting from the perspective entry points with associated deci-
of which APIs to provide and why. sion criteria.
These materials are 2015 John Wiley & Sons, Inc. Any dissemination, distribution, or unauthorized use is strictly prohibited.
24 APIs For Dummies, IBM Limited Edition
These materials are 2015 John Wiley & Sons, Inc. Any dissemination, distribution, or unauthorized use is strictly prohibited.
Chapter 4
The key part of the phrase think APIs is the first word:
Think. Think about what youre trying to achieve business
wise, which audience to engage, what kinds of APIs are
required to engage the audience, and how to curate your data
and application assets (as services) to support those APIs
that you need to provide. In the process, dont forget to think
about what APIs youre going to consume yourself and from
whom. Thinking APIs is not just about being an API provider;
many organizations consume several times the number of
APIs that they provide. These concerns are the core elements
of an effective API strategy.
These materials are 2015 John Wiley & Sons, Inc. Any dissemination, distribution, or unauthorized use is strictly prohibited.
26 APIs For Dummies, IBM Limited Edition
These materials are 2015 John Wiley & Sons, Inc. Any dissemination, distribution, or unauthorized use is strictly prohibited.
Chapter 4: API Entry Points 27
requires careful thoughtnot just in terms of the root
value provided, but also in terms of the form that makes
consumption attractive.
API terms and conditions: Dont forget to include in your
considerations the terms and conditions under which
API consumption may happen, such as freemium, pay as
you go, or prepaid contract.
API implementation: The way you curate the data
and function to implement the APIs comes down to
quality and reliability. Some people say that cost of
implementation is the most important factor, but imple-
mentation cost wont make or break a data-monetizing
strategy. What decides long-term viability is whether
the intended API consumers experience both value and
trustworthiness.
Consuming somebody elses APIs: In some cases, you
also need to consider which APIs to consume. Although
you generate value primarily by providing APIs for others
to consume, implementing those APIs may involve creat-
ing higher-level composites of existing APIs, most often
by blending those existing APIs with something thats
uniquely yours.
Freedom toInnovate
Freedom to innovate is the most important imperative
for many businesses today. Try early, learn fast, scale
easilykey characteristics of a dynamic, engaging enter-
prise. The focus of this API entry point is to chase business
opportunities aggressively and to make innovation a learning
process through the following model:
These materials are 2015 John Wiley & Sons, Inc. Any dissemination, distribution, or unauthorized use is strictly prohibited.
28 APIs For Dummies, IBM Limited Edition
These materials are 2015 John Wiley & Sons, Inc. Any dissemination, distribution, or unauthorized use is strictly prohibited.
Chapter 4: API Entry Points 29
Keep the predefined APIs small and simple. Exposing the
full data structure of a customer back-end system proba-
bly wouldnt be easy for an innovative channel developer
to consume.
API terms and conditions: The terms and conditions under
which API consumption happen remain important not in
terms of payment, but in terms of protecting the security
and stability of back-end systems. After all, innovation is
unpredictable.
API implementation: The way you curate the data and
functions required to implement the APIs is different for
preplanned enterprise APIs and opportunistic, demand-
driven APIs:
For preplanned APIs, you must make careful deci-
sions about which data segments to expose at an
organizational level. Also, your implementation
(typically proxying enterprise services) needs to
take ultimate runtime cost into account. Preplanned
APIs will be used in unpredictable ways, so runtime
cost must not be a preventing factor for such use.
For opportunistic APIs, the most important consid-
erations are development speed and development
cost. If you have to do a hack to get the API out the
door today rather than next week, do so as long
as you have a viable plan for cleaning up the API
implementation if and when that API becomes a
success.
Many opportunistic APIs may not live very long. If
it turns out that you need something different, just
scratch the opportunistic API and start over in the
next iteration of the learning process.
Consuming somebody elses APIs: Considering which
third-party APIs to consume is important for this entry
point. As a simple example, building social mobile apps
is difficult without accessing APIs from well-known public
social services such as Twitter, Facebook, and LinkedIn.
These third-party APIs should be part of the API catalog
that you provide your internal developers; they shouldnt
have to go to some external site to find things themselves.
You may even want to curate the third-party APIs into your
own, simpler version, as some of the public APIs are quite
complex in their native forms.
These materials are 2015 John Wiley & Sons, Inc. Any dissemination, distribution, or unauthorized use is strictly prohibited.
30 APIs For Dummies, IBM Limited Edition
These materials are 2015 John Wiley & Sons, Inc. Any dissemination, distribution, or unauthorized use is strictly prohibited.
Chapter 4: API Entry Points 31
Just for the fun of it, some IBM developers tested whether
it was possible to take a piece of data on a mainframe and
put it on a mobile device, using an API approach, in 10 to 15
minutes. It was indeed possible! There wasnt any pretty API
design, but it proved that the complexity of integration logic
can largely be taken out of the equation by appropriate use of
API and integration technology.
These materials are 2015 John Wiley & Sons, Inc. Any dissemination, distribution, or unauthorized use is strictly prohibited.
32 APIs For Dummies, IBM Limited Edition
These materials are 2015 John Wiley & Sons, Inc. Any dissemination, distribution, or unauthorized use is strictly prohibited.
Chapter 4: API Entry Points 33
If to a consumer everything is a (remote-able) API, then the
consumer doesnt need to know anything about where and how
that API is hosted. Syndicated API catalogs can and should pro-
vide visibility across domain and provider boundaries. In this
API entry point, one of the most important aids for a developer
is the catalog of APIs that are readily available for consumption.
Dont show every single API out there (there are too many);
show only the ones that are relevant to the developer in ques-
tion. That developer shouldnt have to care about how and why
the API is procured; she should focus solely on what she can do
with the API after it has been made available to her.
Figure4-1: U
sing APIs as the lingua franca for a hybrid environment.
These materials are 2015 John Wiley & Sons, Inc. Any dissemination, distribution, or unauthorized use is strictly prohibited.
34 APIs For Dummies, IBM Limited Edition
These materials are 2015 John Wiley & Sons, Inc. Any dissemination, distribution, or unauthorized use is strictly prohibited.
Chapter 4: API Entry Points 35
are concerned, IT operations has no built-in way
of enforcing API-level security and traffic controls;
unmanaged APIs must instead be invoked through
secure tunnels established at the network level.
API implementation: The way that you curate the
data and functions to implement the APIs differs for
preplanned enterprise APIs and opportunistic, demand-
driven APIs. As described in Freedom to Innovate ear-
lier in this chapter, the key differences are robustness
and runtime cost versus time and development cost.
Consuming somebody elses APIs: Considering which
third-party APIs to consume is harder for this entry
point than for any of the other entry points because
over time, the number and variety of available APIs is
dramatically greater.
The best advice is to start simple on API consumption.
Pick a small number of important APIs that you want to
consume: social APIs, analytical APIs, mobile back-end
APIs, or something else, depending on your most immedi-
ate business need. You also have the option of curating
third-party APIs into your own simpler or more con-
trolled version, so take that option into account in your
decision-making.
These materials are 2015 John Wiley & Sons, Inc. Any dissemination, distribution, or unauthorized use is strictly prohibited.
36 APIs For Dummies, IBM Limited Edition
These materials are 2015 John Wiley & Sons, Inc. Any dissemination, distribution, or unauthorized use is strictly prohibited.
Chapter 4: API Entry Points 37
because its APIs are by definition unmanaged. Terms and
conditions are not as important for this entry point as
they are for the others. Much more important is having a
good library of available device APIs.
In some cases you do want to control access to the
device-level APIs and can do so by adding in front of the
device APIs a layer of managed proxy APIs with built-in
security controls.
API Implementation: For device APIs, the methods used
to curate the data and functions to implement the APIs
arent your concern (unless, of course, you are a pro-
ducer of physical devices).
Consuming somebody elses APIs: Considering which
third-party APIs to consume is very important for this
API entry point. Having the right agreements in place
with third-party suppliers of devices and machinery
is critical. If you dont have updated API documenta-
tion, you simply cant communicate effectively with the
device.
These materials are 2015 John Wiley & Sons, Inc. Any dissemination, distribution, or unauthorized use is strictly prohibited.
38 APIs For Dummies, IBM Limited Edition
These materials are 2015 John Wiley & Sons, Inc. Any dissemination, distribution, or unauthorized use is strictly prohibited.
Chapter 5
These materials are 2015 John Wiley & Sons, Inc. Any dissemination, distribution, or unauthorized use is strictly prohibited.
40 APIs For Dummies, IBM Limited Edition
These materials are 2015 John Wiley & Sons, Inc. Any dissemination, distribution, or unauthorized use is strictly prohibited.
Chapter 5: API and Integration Middleware 41
APIs must be made available to app developers in a self-
service fashion. Any kind of post-deployment approval
process slows the adoption rate and ultimately, at scale,
generates significant organizational costs.
The preferred sharing mechanismone that has proved
to be highly effectiveis publishing APIs to developer
portal environments. In particular for internal API use,
sharing is preferably managed on a community basis,
making sure that given developers see only the APIs that
their community is supposed to use.
General-purpose ESBs include none of these features, and
even service management solutions (whether embedded
or separate) are aimed more at service development time
controls and operational controls than at optimizing the
developer sharing process.
Finally, API owners need business statistics about who
uses their APIs and how much. These statistics measure
success against the business objectives for the portfo-
lio of APIs rather than focusing on IT concerns such as
the operational dashboards typically included in ESB
platforms.
Some people may argue that you need only one bus, which
can be repurposed to support classical integration needs,
service-oriented architecture (SOA), and also API manage-
ment. Yet without providing dedicated experiences for the API
developer, API owner, and API consumer, you risk engineering
the middleware for the lowest common denominator. Not to
mention that the classical integration developers also need
their separate optimized experience. Further, if you need only
API management or general-purpose integration capabilities,
why pay for both?
These materials are 2015 John Wiley & Sons, Inc. Any dissemination, distribution, or unauthorized use is strictly prohibited.
42 APIs For Dummies, IBM Limited Edition
These materials are 2015 John Wiley & Sons, Inc. Any dissemination, distribution, or unauthorized use is strictly prohibited.
Chapter 5: API and Integration Middleware 43
concentric circles with different types of integration capabili-
ties. The standard integration topology for each domain can
be composed to a system-of-systems topology across multiple
domains simply by repeating the pattern. In other words, the
domain structure can be defined by the needs of the enterprise,
yet the API sharing and consumption mechanisms remain the
same. This structure crisply addresses the system-of-systems
nature of hybrid integration environments and is a good fit for
any API entry point defined in Chapter4.
These materials are 2015 John Wiley & Sons, Inc. Any dissemination, distribution, or unauthorized use is strictly prohibited.
44 APIs For Dummies, IBM Limited Edition
These materials are 2015 John Wiley & Sons, Inc. Any dissemination, distribution, or unauthorized use is strictly prohibited.
Chapter 5: API and Integration Middleware 45
Its important not to make decisions about the parts of the refer-
ence model in isolation. Instead, use an integrated middleware
strategy to turn assets into business advantages.
These materials are 2015 John Wiley & Sons, Inc. Any dissemination, distribution, or unauthorized use is strictly prohibited.
46 APIs For Dummies, IBM Limited Edition
These materials are 2015 John Wiley & Sons, Inc. Any dissemination, distribution, or unauthorized use is strictly prohibited.
Chapter 6
These materials are 2015 John Wiley & Sons, Inc. Any dissemination, distribution, or unauthorized use is strictly prohibited.
48 APIs For Dummies, IBM Limited Edition
The terms buy and sell are used deliberately even though
the economic models behind APIs vary widely. Whether the
price is cash or influence, whether the model is consumer-
paid or provider-paid, the product nature of the API persists.
Business Design Is an
End-to-End Endeavor
APIs are no longer just IT concerns. APIs should be part of
your end-to-end business design.
These materials are 2015 John Wiley & Sons, Inc. Any dissemination, distribution, or unauthorized use is strictly prohibited.
Chapter 6: Ten Things to Know about APIs 49
These materials are 2015 John Wiley & Sons, Inc. Any dissemination, distribution, or unauthorized use is strictly prohibited.
50 APIs For Dummies, IBM Limited Edition
When you use a third-party API, take care that your own
businesss integrity wont be negatively affected. The vehicle
you useformal agreements with penalties, compensation
mechanisms, or judicious evaluation of API robustness and
securitymatters less than the fact that youve taken proper
precautions. Remember to include ethical concerns in your
consideration.
These materials are 2015 John Wiley & Sons, Inc. Any dissemination, distribution, or unauthorized use is strictly prohibited.
WILEY END USER LICENSE
AGREEMENT
Go to www.wiley.com/go/eula to access Wileys
ebook EULA.