RESTful APIs can run in a wide variety of settings, but the most common has become the public cloud.
RESTful APIs can run in a wide variety of settings, but the most common has become the public cloud. These lessons will explore the various API products offered by the major cloud service providers and demonstrate how a simple API may be configured and launched using the AWS API Gateway product.
The module also explores the alignment of REST methods and endpoints with business processes, both existing and new ones. Because REST services rely on HTTP methods, it is important to understand how business processes send and consume data, and how their operations are best represented within REST.
Another design consideration of great importance is the challenge posed by the need to fix and improve existing API services. Upgrading or patching API services without carefully considering the consequences can be disastrous; but we’ll show you how to use API versioning to handle these problems properly.
Learning Objectives:
- Identify the primary public cloud providers and their service offerings that support RESTful APIs
- Understand how HTTP methods represent specific types of actions and how legacy or new processes can align with the methods
- Describe how versioning can avoid conflicts and introduce enhancements in a responsible manner
Skills you’ll gain
Advanced Rest ClientAPI DesignAPI ManagementREST API DevelopmentRest ClientRESTful APIWhat You'll Learn
- Identify the primary public cloud providers and the service offerings that support RESTful APIs
- Configure and launch a simple API using the AWS API Gateway product
- Align REST methods and endpoints with existing and new business processes
- Explain how HTTP methods represent specific types of actions for legacy or new processes
- Apply API versioning to fix and improve existing API services without causing conflicts
Key Takeaways
- RESTful APIs can run in many settings, but the public cloud has become the most common.
- Because REST services rely on HTTP methods, understanding how business processes send and consume data is key to representing their operations in REST.
- Upgrading or patching API services without considering the consequences can be disastrous.
- Versioning lets you avoid conflicts and introduce enhancements in a responsible manner.
Frequently Asked Questions
What does this course cover?
It explores the API products offered by the major cloud service providers, demonstrates configuring and launching a simple API with the AWS API Gateway, covers aligning REST methods and endpoints with business processes, and explains using API versioning to fix and improve existing services.
Will I learn how to use a specific cloud provider's tools?
Yes. The lessons demonstrate how a simple API may be configured and launched using the AWS API Gateway product, and explore the various API products offered by the major cloud service providers.
How is the course structured?
It is organized into three lessons: REST API Design Considerations, Aligning Operations with HTTP Methods, and API Versioning Maintenance.
What skills will I build?
The course builds skills in API Design, API Management, REST API Development, and working with REST and RESTful API clients, including advanced REST client usage.
Transcript
Show transcript (free preview lesson)
Transcript of the free preview lesson. Remaining lessons unlock with the full course.
Hello, my name is Josh Gardino, and in these lessons, you will learn about REST API design considerations. Let's begin by exploring REST APIs in the cloud. Almost all new APIs are built for and deployed to public clouds, and many legacy APIs have been or will soon be migrated to the cloud. The advantages of public cloud are numerous. For API providers, it means that they do not need to be concerned with physical hardware or hosting of APIs or ancillary services such as databases. All of this can be done in the public cloud and configured through a web console. Each of the major public cloud providers offer a suite of tools to assist with API hosting, delivery, security, and cloud enablement. Amazon Web Services or AWS offers an API Gateway as well. And again, with full support for RESTful APIs. Let's explore the AWS API Gateway service. We will begin by creating an API. Let's call it test and look at some of the details. AWS is assigned it a unique ID, a root URL and a default stage. So let's begin by creating a root and method. All of the usual HTTP methods are shown. So let's select GET and we will also define a path /drivers to which we can deploy our Department of Motor Vehicles API where the REST services under drivers. So now we have the /drivers route configured with a GET method endpoint. This path would now be available to be invoked by a REST API client, but it can't do much on its own. In order to add functionality, we need to attach an integration. Integrations involve other AWS services that will provide the business logic that is executed when the REST API endpoint is called. The most common type of integration, and the one that we will use here is AWS Lambda. Lambda's are serverless lightweight processes that support a wide variety of programming languages. And I have an existing Lambda setup called drivers-get-lambda. And this Lambda is suggested as the integration point. So let's go ahead and select it. And now the GET endpoint is tagged with AWS Lambda so all requests to the GET endpoint will be handed off to the Lambda. The Lambda that we'll use here is a very simple Node.js, JavaScript Lambda. All that this Lambda does when a request comes through is to return a JSON array containing all of the drivers. For simplicity, we have hard coded it here. So now that we have our API Gateway instance created, a /drivers GET endpoint configured and a Lambda function integrated with the API, let's try to send a request. Because this is a GET request, we can do this from a web browser. So let's use the unique base URL that AWS provided and add /drivers to the URL. And as you'll see here, the full JSON array of all driver information is shown. Now let's move on to try to invoke this service from Postman. Let's start a new collection in Postman and we will call it AWS and add a new request. We'll call it GET/drivers and paste in the URL. We'll click send, and here are the drivers in JSON format and a 200 status code. The API Gateway tool in AWS also provides many services to support the API, including throttling tools to limit the incoming traffic, metrics and logging using the CloudWatch product where we can see full details of every incoming request and potentially see all of the responses that were sent. Similar services offered by Microsoft Azure and the Google Cloud Platform work in much the same way and also offer a rich set of integrations with other cloud services. Thanks for watching. Stay tuned for the next lesson where I will show you how operations are aligned to HTTP methods in a RESTful API.
Learn on the Go
Take your learning anywhere — the KnowledgeCity mobile app lets you watch lessons on the go.