Learn API development with Ruby on Rails

Modern web applications have to deliver interactivity and options that server-rendered HTML just can’t provide. With more clients being written in JavaScript and native mobile technologies, we need backend applications that speak the web’s new bridge — JSON.

As a Rails developer, your experience gives you a head start when it comes to developing API applications, but to be effective, you need to learn to apply your skills to a new set of problems. This course will help you make the jump with complete confidence.

RESTful Services for Your Apps and Integrations

Are you building a single-page application or mobile app? Or maybe you need to open up your application for integrations. If it's time to break out of the monolith, the book can help you get your head around the basics of API design, development, and testing for your new API endpoints based on REST principles.


Secure Your API and Limit Access to Sensitive Data

Knowing who your users are and what information they're allowed to access is essential for most grown-up applications, but APIs need to use different techniques than traditional Rails web apps. In this book, we'll look at three models popular with API developers and show when and how you can apply each one.


Interface Designs That Stand the Test of Time

Developing a stable API is only about 20% about coding. The other 80% comes down to making good design decisions and applying them consistently throughout your application. We'll study some of the most common design challenges and look at patterns and tools to help solve them.

Table of Contents

  • Welcome to Developing Rails API Applications
  • Rails APIs: The First 10 Minutes
  • Coding Your First RESTful Resource
  • Serializing Model Data
  • Testing Your API
  • Solutions to Common Requirements
  • Basic Authentication
  • Token-Based Authentication with JWTs
  • OAuth Authentication
  • Getting a Head Start with JSON:API
  • Where Do We Go From Here?

About the Author

I'm Chris Kottom, and I've been working on the web since the mid-90s. In 2006, feeling burned out after 10 years as a Java developer, I rediscovered my love of coding through Ruby on Rails, and I've been at it ever since.

When I started with web applications, it was all about server-side rendering, and the limits to interactivity really came down to how creative you could be hacking applications with that as your only tool. As things started to change, first with Ajax and later with client-side rendering and full single-page applications, I started getting curious about how best to structure server-side apps for maximum scale and maintainability. This book represents my own learning curve and the lessons and techniques I picked up along the way.

Get in touch with questions or comments via email or Twitter.