Create a REST API using basic PHP with Token Authentication - Real world example of a to-do list API | Michael S. | Skillshare

Playback Speed


  • 0.5x
  • 1x (Normal)
  • 1.25x
  • 1.5x
  • 2x

Create a REST API using basic PHP with Token Authentication - Real world example of a to-do list API

teacher avatar Michael S., Mobile Systems Developer

Watch this class and thousands more

Get unlimited access to every class
Taught by industry leaders & working professionals
Topics include illustration, design, photography, and more

Watch this class and thousands more

Get unlimited access to every class
Taught by industry leaders & working professionals
Topics include illustration, design, photography, and more

Lessons in This Class

43 Lessons (14h 40m)
    • 1. Introduction

      1:35
    • 2. Course Contents and Project Scenario

      2:47
    • 3. What is REST?

      8:19
    • 4. Software Set up

      6:09
    • 5. Task API Requirements

      3:34
    • 6. Authentication API Requirements

      2:23
    • 7. Demo of Completed API - What we will be building within this course

      24:13
    • 8. Tasks Database and Task Table Creation

      12:33
    • 9. Set Up API Folder Structure

      4:35
    • 10. Create the Response Model

      38:58
    • 11. Set Up The Database Connection

      22:52
    • 12. Create The Task Model

      32:55
    • 13. GET - Get a Single Task

      44:41
    • 14. DELETE - Delete a Single Task

      9:27
    • 15. GET - Get All Complete and Incomplete Tasks

      22:22
    • 16. GET - Get All Tasks

      17:47
    • 17. GET - Get All Tasks With Pagination

      37:02
    • 18. POST - Create a Task

      49:19
    • 19. PATCH - Update a Task

      55:22
    • 20. Mid Course Review - What we have done so far

      1:18
    • 21. Introduction to Token Based Authentication

      11:22
    • 22. Users Table Creation

      5:34
    • 23. POST - Create a User (Sign up user API)

      43:00
    • 24. Sessions Table Creation

      7:41
    • 25. POST - Create a Session (Log user in API)

      82:23
    • 26. DELETE - Delete a Session (Log user out API)

      25:25
    • 27. PATCH - Refresh a Session (Get new access token API)

      51:20
    • 28. Update Tasks Table - Add User Assignment

      4:07
    • 29. Add Authentication to our Tasks API

      47:16
    • 30. Course Conclusion and Demo Client Application

      10:49
    • 31. BONUS Section 01 - What is CORS And How Do We Allow This On Our REST API

      16:41
    • 32. BONUS Section 02 - Adding Image Upload Functionality To Our API Intro

      10:22
    • 33. BONUS Section 02 - Demo of Image Upload API

      15:52
    • 34. BONUS Section 02 - Implement Folder Structure To Store The File Uploads

      5:16
    • 35. BONUS Section 02 - Task Image Database Table Creation

      5:22
    • 36. BONUS Section 02 - Implement The Image Model

      34:30
    • 37. BONUS Section 02 - Implement The Image Route Logic

      38:27
    • 38. BONUS Section 02 - POST - Implement The Upload Image Route

      66:03
    • 39. BONUS Section 02 - GET - Implement The Get Image Attributes Route

      12:20
    • 40. BONUS Section 02 - GET - Implement The Getting Of The Actual Image File

      16:45
    • 41. BONUS Section 02 - PATCH - Implement The Update Image Attributes Route

      43:17
    • 42. BONUS Section 02 - DELETE - Implement The Image Deletion Route

      19:43
    • 43. BONUS Section 02 - Integrate Images Into Task API

      37:44
  • --
  • Beginner level
  • Intermediate level
  • Advanced level
  • All levels
  • Beg/Int level
  • Int/Adv level

Community Generated

The level is determined by a majority opinion of students who have reviewed this class. The teacher's recommendation is shown until at least 5 student responses are collected.

205

Students

--

Projects

About This Class

ff693b55

In this course I will be showing you how to create RESTful web services with PHP, no third party frameworks or paid software is needed.

We will be covering the basics of what REST is and how to implement the basics using pure vanilla PHP, at the end of this course you should be able to create a basic RESTful web service that you can allow other people to use.

The course will follow a scenario that we have been given and that is to implement a web service which can record a list of tasks, basically a to-do list. We will be implementing each requirement one at a time and then we will add on the ability for this API to become a multi user service. So each user can securely have their own task list.

To do this we will be implementing an authentication concept called Token based authentication and we will be exploring this further within the course, Token based authentication is a lot more secure than just basic password authentication and is now a best practice among the industry.

We will be starting at the beginning and building as we go, as long as you know the basics of PHP, such as variables, if statements, loops, arrays and some basic object orientated programming concepts you should be able to follow this course to the end.

We will also be using MySQL for the database to store the tasks and we will be building and changing the database as we go, and again you don't need to be an expert on MySQL but just need to know the fundamentals such as basic select, update, delete SQL statements and concepts such as primary keys and foreign keys.

The RESTful api can then be used by web and mobile apps (both iOS and Android).

BONUS SECTION 01 ADDED - for CORS (Cross-Origin Resource Sharing) which will allow you to adjust this API to run on a different domain/subdomain than your front end application.

BONUS SECTION 02 ADDED - for teaching you how to upload images/files against a task, we will go through the changes we need to make to the API to allow uploading of images to a task. We will then allow you to associate image attributes such as title and filename against the image as well as being able to download the image and delete the image.

Meet Your Teacher

Teacher Profile Image

Michael S.

Mobile Systems Developer

Teacher

Hi

I have been programming for over 13 years using PHP, SWIFT, HTML, CSS and Javascript and have all round experience of Web Systems and system architecture.

Programming is not just part of my job but it is a hobby too, and I am interested in the full stack, from the infrastructure, to the security, to the user experience.

See full profile

Class Ratings

Expectations Met?
  • Exceeded!
    0%
  • Yes
    0%
  • Somewhat
    0%
  • Not really
    0%
Reviews Archive

In October 2018, we updated our review system to improve the way we collect feedback. Below are the reviews written before that update.

Why Join Skillshare?

Take award-winning Skillshare Original Classes

Each class has short lessons, hands-on projects

Your membership supports Skillshare teachers

Learn From Anywhere