APIs in PHP: from Basic to Advanced

Learn how to use third-party APIs in your PHP projects, and develop your own RESTful API using plain PHP and MySQL

An API is a way for a program to interact with another program. By using third-party APIs from your code, you can utilise functionality developed elsewhere. By creating an API to access your own data, other programs can take advantage of your services in a secure and easy fashion.

What you’ll learn

  • Understand how APIs work.
  • Learn how to use an API from PHP.
  • Create an API from scratch in plain PHP.
  • Create, Read, Update, Delete (CRUD) using an API.
  • Understand what REST and RESTful APIs are.
  • Create a RESTful API in PHP.
  • Understand how different API authentication mechanisms work.
  • Create API-key authentication for your API.
  • Understand how JSON web tokens (JWTs) work, the advantages and disadvantages, and why we use them.
  • Understand how HTTP requests and responses work.

Course Content

  • Introduction: how to use the course and software installation –> 3 lectures • 4min.
  • API basics: what APIs are and how to use them –> 4 lectures • 15min.
  • HTTP basics: requests, responses and using cURL –> 8 lectures • 31min.
  • REST and RESTful APIs: using them from PHP –> 4 lectures • 18min.
  • Create a RESTful API: build a framework for serving the API –> 9 lectures • 37min.
  • Create a RESTful API: create a database and retrieve data from it –> 10 lectures • 31min.
  • Create a RESTful API: create, update and delete individual resources –> 8 lectures • 34min.
  • API key authentication –> 12 lectures • 38min.
  • An introduction to authentication using access tokens –> 8 lectures • 29min.
  • Authentication using JSON Web Tokens (JWTs) –> 8 lectures • 28min.
  • Expiring and refreshing access tokens –> 14 lectures • 43min.
  • Conclusion –> 1 lecture • 1min.

APIs in PHP: from Basic to Advanced

Requirements

  • You need to know PHP, including the basics of classes and objects, and how to work with a database.
  • You need to be happy using the command line, although full instruction on what commands to use will be given.
  • Ideally have a web server with PHP and Composer installed, but a brief overview of installing these will be covered.

An API is a way for a program to interact with another program. By using third-party APIs from your code, you can utilise functionality developed elsewhere. By creating an API to access your own data, other programs can take advantage of your services in a secure and easy fashion.

Learn how to Use and Create Secure and Scalable APIs in PHP in this Comprehensive Course.

  • Understand how APIs work
  • Learn how to use an API from PHP
  • Understand how HTTP requests and responses work
  • Understand what REST and RESTful APIs are
  • Create a RESTful API from scratch, using plain PHP and MySQL
  • Understand how API authentication works
  • Add API key authentication to your API
  • Understand how JSON Web Tokens (JWTs) work
  • Add JWT access token authentication to your API

The essential skills required to use and develop APIs with PHP.

Unless you create every component of your application from scratch, your code will need to interact with external services – for example a payment gateway, or currency data. To use such services, you need to consume their APIs. On this course you’ll learn how to do this from PHP, and also how to create an API so that external programs can interact with your application.

Content and Overview

This course is designed for the PHP developer who wants to learn in depth how to use APIs from their code. I designed the course to be easily understood by PHP developers who have no previous experience of using APIs, and who want to develop full, secure APIs quickly and easily. Learning the techniques on this course will enable you to create APIs that are secure, robust and that comply with industry standards.

  • Suitable for all PHP developers, you’ll start by learning the basics of how APIs work.
  • You’ll learn various techniques for consuming APIs from PHP, along with their advantages and disadvantages.
  • We’ll build a full API from scratch, with each concept explained in detail at every stage.
  • You’ll learn what REST and what RESTful APIs are, why we use them, and how to make your API RESTful.
  • Throughout the course, we’ll build code that you can reuse in all your projects.
  • All the source code developed in the lectures is available to download.
  • All the time we’ll adhere to industry standards and best practices.
  • Each section has short, self-contained lectures that you can go back to reinforce specific concepts if you need to.

When you complete the course you’ll be able to use APIs in your PHP applications to leverage third-party components and services. You’ll also be able to create your own API, using various authentication techniques depending on the type of API you want to create.

Complete with all the code shown in the lectures, you’ll be able to work alongside the instructor and will receive a verifiable certificate of completion upon finishing the course.

Also, at all times throughout the course you have access to the instructor in the Q&A section to ask for help with any topic related to the course.

Enrol now and become a master of APIs in PHP!

Get Tutorial