Building APIs in PHP Using the Slim Micro Framework

Author

Released

10/10/2016

A well-designed API includes not just URLs and response codes but also authentication, consistent structures, and useful JSON payloads. Luckily, the Slim micro framework makes it easy to move an API from concept to implementation to production. What used to take weeks or even months can usually be done in hours or days with Slim.

This course begins with a simple application specification and builds it one step at a time. Each chapter includes a key concept, with examples from other public APIs, and then shows how to build it yourself with Slim. Learn about URL routing, validating input, and generating response codes and hypermedia payloads. Like any project, the first implementation may be a little messy but don't worry. The last chapter covers refactoring and what it takes to scale and support the API going forward.

Topics include:

Understanding the project goals

Setting up the database

Adding authentication in Slim

Using cross-framework and authentication middleware

Creating a read-write API in Slim

Uploading files via the API

Adding file security

Creating payloads and response codes in Slim

Scaling your API

Skill Level Beginner

1h 52m

Duration

50,628

Views

Show MoreShow Less

- [Instructor] Hello, and welcome to building APIs in Slim.In this course, will start from a simple API specification,and begin building a useful API.We'll talk about everything from URL routes,and validating input, to generating HTTP response codes,and hypermedia payloads.Now generally, most developers willtry to do this in one big step,going from no API whatsoever to a complete solutionthat solves every imagined problem.In my experience, that never works.First, there are requirements and informationthat you just don't have at the beginning of the project,but more importantly,your own understanding of the underlying problem,as the tools available, improves over time.

Therefore, we're going to approach this projectthe same way I recommend you approachevery project, iteratively.