Web APIs with Ruby on Rails

Programmers familiar with the Ruby on Rails framework who want to use Ruby on Rails to create web APIs


Expected Duration
135 minutes

This course covers how to develop webAPIs using the Ruby on Rails framework. It covers how to set up an API, create API endpoints and render XML and JSON. It also covers versioning and authentication as well as documentation and testing.


Building an API

  • start the course
  • use the Rails-api Gem
  • set up a Rails API
  • add an API to an existing Ruby on Rails project

API Endpoints 

  • create an API endpoint for INDEX
  • create an API endpoint for SHOW
  • create an API endpoint for CREATE
  • create an API endpoint for UPDATE
  • create an API endpoint for DESTROY

Rendering JSON and XML

  • render JSON manually
  • render JSON with the jbuilder gem
  • render JSON or XML with the rabl gem
  • render JSON with active_model_serializers
  • generate XML with XML builder

Optimizing JSON and XML

  • speed up JSON with the oj Gem
  • speed up XML with the ox Gem

Versioning and Authentication

  • implement versioning for an Ruby on Rails API
  • authenticate a web API manually


  • document a web API with rdoc
  • document a web API with apipie-rails


  • implement testing of a web API with RSpec
  • manually test a Rails API with Postman
  • test the performance of a Ruby on Rails API with rails-perftest

Practice: Building a Ruby on Rails API

  • create an API and API endpoints in a given scenario





Multi-license discounts available for Annual and Monthly subscriptions.