Time for action – creating an API to get all the recipes under a recipe type

Now we will create our next API, which is for exposing all the recipes under a recipe type:

  1. We will have a new view created in the same manner, but instead of selecting Taxonomy terms, we will be choosing contents of all type recipes.
    Time for action – creating an API to get all the recipes under a recipe type
  2. In the REST export settings, give the URL as api/recipes/%. The % sign acts as the wildcard, which will recipe type tid as the argument.
    Time for action – creating an API to get all the recipes under a recipe type
  3. In the views settings page, we configure the view just like we did it for the recipe type. The fields that ...

Get Drupal 8 Development Beginner's Guide - Second Edition now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.