4.6 out of 5
4.6
118 reviews on Udemy

Professional RESTful API Design using Python Flask

Learn the fundamental concepts and build a RESTful API application from scratch
Instructor:
Jorge Escobar
1,274 students enrolled
English [Auto-generated]
You will learn the fundamental concepts for the design of RESTful API platforms
You will be introduced to the RESTful API constraints
You will learn how to setup an authentication API layer
You will learn how to effectively build API endpoints

This course will teach you how to build a professional API platform using pure Flask, without any supplemental libraries, so that students can learn the fundamentals of RESTful API design.

In today’s world, dominated by gorgeous JavaScript user interfaces and mobile applications, the ability to build a scalable and well architected API is key to be able to supplement those applications and ensure that clients and servers communicate with the proper interfaces.

The course covers the basic concepts of the RESTful API pattern and then goes into detail and step by step building an API platform that will cover the six constraints of the architecture. Students will learn the industry-standard and will follow best practices for API architectures.

At the end of the course students will be able to design, architect and build their own RESTful API platforms, and with the deep understanding of the laws governing APIs, can go ahead and try out the API libraries available for Python and Flask, knowing the fundamentals and the advantages of using them.

If you already know the basics of Flask and you are interested in how to design, architect and build an API platform, this is the course for you.

The course is divided in 2 sections:

  • Introduction which covers all the concepts necessary to understand what is a RESTful API and its six constraints

  • A step by step explanation building a Pet Store API that will include an authentication layer, a Store endpoint and a Pet endpoint as well as search functionalities

The course has more than 5 hours of video tutorials as well as the source code at the end of each section, so that you can follow along with the coding process.

The course can take anywhere from 3 to 10 days to complete based on how much material the student completes daily.

Additionally we’re constantly updating the course, adding contents thanks to the feedback of our students.

Join this course and continue your path to becoming a professional backend web developer!

Introduction

1
Introduction

Introduction
- What do we want to accomplish in this course?
- Prerequisites
- What do I need to have to complete this course?

2
APIs and the Six Constraints of REST

What is an API?

  • API stands for "Application programming interface", and it's a set of routines, protocols and tools for building interactions between clients and servers.

What is REST?

  • REST stands for “Representational State Transfer” and it's a networked, hypermedia architectural style typified by the web
  • REST by design has six constraints:
    • Uniform interface
    • Stateless
    • Cacheable
    • Client-server
    • Layered System
    • Code on Demand (optional)
3
The RESTful Uniform Interface Constraint

Uniform Interface

  • Resource-Based
  • Manipulation of Resources Through Representations
  • Self-descriptive Messages
  • Hypermedia as the Engine of Application State (HATEOAS)


A Simple API - Pet Store

1
Installing the Docker Client

Installing the Docker Client

2
Basic Container Structure
3
Running the Container

- Docker client for Mac
  - Docker compose
  - Running the containers separately for pdb

4
Flask Pluggable Views and Our First GET Method

- Using Flask pluggable views
    - Explain Flask pluggable views - http://flask.pocoo.org/docs/0.11/views/
- Our first endpoint, /pets
    - A simple GET pluggable view

5
Using Postman

Using Postman - https://www.getpostman.com/

6
Our First POST

A simple POST handler

7
An Introduction to HTTP Status Codes

Talk about HTTP Status Codes - http://www.restapitutorial.com/httpstatuscodes.html

8
A Real CRUD

- Build a GET individual pet endpoint
- Add location to all pets (HATEOAS)

9
PUT and DELETE

Implement PUT, DELETE on pets

10
A Simple Authentication

Explanation of the authentication design we are going to use

11
Testing our Simple Authentication

- Write a decorator to allow the user to access the API
- Add authentication to headers in Postman

12
Token API Model and API Endpoints

Create the app registration endpoint and generator

13
Token API Views and Decorator

Build the token-based application access decorator

14
Install bcrypt and Test Tokens
15
Building the Apps Tests

Start a testing framework

16
Token Tests

Token Tests

17
Starting the Store End Point

- Build store models
- Don't expose MongoDB ID, use uuid

18
The JSON Schema Library

- Validation of data using jsonschema - http://python-jsonschema.readthedocs.io/en/latest/
  - Great resource - https://spacetelescope.github.io/understanding-json-schema/index.html - to understanding it

19
The Store API File

Build JSON templates

20
Trying out the Stores End Point

Use Postman to test the Store end points

21
Implementing PUT and DELETE

- PUT operations are the update of CRUD. It generally receives all the fields with the ones being updated changed.
  - PATCH is used for updating only specific fields (we won't implement)
- Implement DELETE

22
Implementing pagination on GET all stores

- Pagination
   - Results should always be paginate
   - Links within show next and prev
   - This is the HATEOAS of the app

23
Store Tests

- Testing CRUD
- Testing pagination
  - Introduction to Fixtures
  - Custom fixtures using mongoimport

24
Pet Endpoint Initial CRUD

- Create CRUD

25
Finishing Pet GET, POST and Postman Tests

- Postman Tests

26
Pets PUT and DELETE

- PUT and DELETE for Pets endpoint

27
Pets Tests

- Write tests for Pets endpoint

28
Pets Pagination Tests

- Pets pagination tests

29
Get all Pets in a Specific Store Endpoint

- Use the same Store GET endpoint

30
Testing the get all pets endpoint

Get all pets in a specific store using Postman

31
Search pets across stores

Search pets across stores

  • Implementing filters across stores
  • Create a pets_href template to add filters

Conclusion

1
Congratulations on Finishing the Course!
2
Conclusion

Bonus Section

1
Course Promo
You can view and review the lecture materials indefinitely, like an on-demand channel.
Definitely! If you have an internet connection, courses on Udemy are available on any device at any time. If you don't have an internet connection, some instructors also let their students download course lectures. That's up to the instructor though, so make sure you get on their good side!
4.6
4.6 out of 5
118 Ratings

Detailed Rating

Stars 5
58
Stars 4
43
Stars 3
9
Stars 2
3
Stars 1
5
cd5e52c0e9bea47c5fe08c5a63f6c7c8
30-Day Money-Back Guarantee

Includes

5 hours on-demand video
1 article
Full lifetime access
Access on mobile and TV
Certificate of Completion