Api Development
Api Development
My Home
Course Menu
Get Unstuck
Tools
While there are many frameworks and methodologies for the API lifecycle,
there are typically five chronological stages:
1. Planning and Designing the API
2. Developing the API
3. Testing the API
4. Deploying and Managing the API
5. Retiring the API
Each of these stages is a vital piece to making sure an API is successful. Let’s
dive in and explore the details of each stage.
Typically business team members (or sometimes even engineers) will begin
by mapping out the capabilities of the API and the data it should expose.
This process usually captures the API audience’s needs and the
requirements from various stakeholders.
When the API requirements are done being mapped out, engineering teams
can then begin laying out the architecture of the API. Naming conventions,
protocols, technology, and much more are debated and finalized.
Typically this is also where the API is documented. Often when APIs are
treated as a product (that the team or business makes revenue from), teams
will spend just as much time documenting their API as they will on any of
the other phases. A good example is the IMDB Movie API that offers free
and paid services. Note the extent of the APIs documentation found here.
On some occasions, mainly when APIs are public-facing, APIs are released
into beta where end-users (sometimes only a small percentage) can test and
experiment with the API and give feedback and report bugs. The beta helps
finalize any outstanding issues as well as gain valuable feedback before a
full API release.
This phase is also where APIs are managed for the rest of their lifetime to
deliver guaranteed and high-quality API performance. Management
includes but is not limited to performance tracking, usage analysis,
community building, and a lot more!
Wrap up
To summarize, we learned:
Skip to Content
My Home
Course Menu
Get Unstuck
Tools
Requests
Responses
Free response
While these API URLs might seem easy to comprehend, it’s easy to imagine
our URLs getting very lengthy and confusing in the future. There is also no
clear consistency between what and how each of the resources is called (ex.
“get” vs. “retrieve”). This is why it is best to keep API URLs consistent by only
using nouns. Here are the same API resources re-written with a single noun:
Responses
Give Feedback to Help Developers Succeed
Providing good feedback to developers on how well they are using an API
goes a long way in improving adoption and retention. Good feedback
involves positive validation on correct implementations and an informative
error on incorrect implementations that can help developers debug and
correct how they use the API.
For APIs, errors (and relevant error codes) are a great way to provide
context when things go wrong! In general, there are three possible error
outcomes when using an API:
1. The client application behaved erroneously (client error - 4xx
response code)
When designing an API, describe these error responses well, but keep them
concise and neat. In addition, use specific response codes to detail errors
accordingly in the API (check out this great resource on error codes). Lastly,
provide enough information in the error codes for an end-user to start work
on fixing the cause, and, if there’s more information needed, provide links
to additional documentation.
Requests
Handle complex requests elegantly
An API should be able to access many different types of data, so we want to
be mindful of organizing it to best help our end-user. We want to make
sure that our data is complete, available, and accounts for relationships
between different types of data. In the interest of performance, we’d only
want to surface the relevant data that an end-user needs and even consider
limiting the amount of data they get in the response.
Wrap up
To summarize, we learned:
There isn’t a single approach to API design that will work for every
individual or organization. The above suggestions are just that — advice
and recommendations which can be used or discarded depending on our
end-users needs.
Back
Next
Skip to Content
My Home
Course Menu
Get Unstuck
Tools
Among all the phases in the API lifecycle, documentation is the area
showing the most growth. This is especially true with the tooling ecosystem
around documentation. Since documentation is traditionally something that
fell on the backburner for development teams, it also means that there’s a
lot of room for growth. We can have the best functional API, but no one will
use it if they don’t know how to.
Wrap up
To summarize, we learned:
Skip to Content
My Home
Course Menu
Get Unstuck
Tools
Introduction
APIs are only as good as their documentation — a great API can be
rendered useless if people don’t know how to use it. However, creating and
maintaining good documentation that’s easy to read, enjoyable to interact
with, and sets the end-user up for success, can be extremely challenging.
Creating excellent documentation requires effort and patience, but it has
direct implications for API adoption and maintainability. In this article, we’ll
start by looking at who we should design documentation for and then
follow up with exploring some common best practices. Let’s dive in!
Multiple choice
A Changelog
A changelog is a document, usually published on an APIs website, that
should detail updates and versions of an API and how it might affect API
end-users. This will help end-users know the stability of the API and see if
any changes need to be made to their integration with the API.
An Authentication Guide
An API’s documentation should have a section dedicated to any
authentication (if it exists) required to start consuming the API’s data. Most
APIs have authentication schemes, and end-users have to authenticate
before gaining access to the API. Make sure this section is adequately
documented and hand-holds end-users to authenticate against the API
successfully.
A Interactive Console
One way to encourage end-users to test what they read in the API
documentation immediately, is to provide an interactive API console.
Experimentation is powerful, and a console makes getting started easy, with
limited liability from the end-users perspective. An interactive console can
go a long way in helping developers learn about an API’s value very quickly.
Before we wrap up, let’s review:
Free response
Submit Response
Wrap up
To summarize, we learned:
Next
6 days left to meet your weekly target. Keep up the good work!
M
T
W
T
S
S
1 / 7 days