REST Easy: Fun & Profit with Commerce Services

REST is an architectural paradigm we use to design web services. The largest implementation of REST is actually the world wide web! Thanks to the rise of the "Headless Drupal" movement, it's also the most talked about way to liberate the data locked away in your Drupal site. Drupal based REST APIs serve content to JavaScript based web applications, power the back end of mobile applications, and even facilitate communication between other Drupal sites.

This session provides an overview of the basics of REST and walks through a working example that shows them in practice. It gives special attention to the interface requirements that determine how REST servers and clients interact:

  1. The identification of resources, e.g. /node/1
  2. Manipulation of resources through representations, e.g. PUT /node/1
  3. ”Self-descriptive” messages, e.g. Accept: application/hal+json
  4. Hypermedia as the engine of application state, e.g. { “_links”: { ... } }

Fortunately, you get all of this (mostly) for free out of the box in Drupal 8, and in Drupal 7 there are a variety of contributed modules available to support you. Even better, the leading voices advocating Headless Drupal wed it to pragmatic development, making the work both fun and profitable.

The primary use case in this session will be a Commerce application server built with Commerce Services. It demonstrates the traversal of a Commerce API from the “home page” to a product page and on to a shopping cart form where the user would then proceed to checkout. We’ll highlight the strengths of the module’s collection resources (i.e. groups of products, line items, etc.) built for pragmatic development guided by the best practices of a leading API hosting and service company.

See also: Toward HyperDrupal and Extending Drupal 7 Services into an E-commerce App

Schedule info
Track: 
Coding and Development
Experience level: 
Advanced
Drupal Version: 
Drupal 8.x
Status: 
Unprocessed