12

Building APIs with Drupal

Drupal 10 comes with several awesome features to help facilitate building out RESTful APIs using the core Serialization and JSON:API modules. These enable you to build headless and/or decoupled solutions that can still interact with and query for data in Drupal.

In this chapter, we will look at how to do the following:

  • Fetching data from Drupal using JSON:API (https://jsonapi.org/)
  • Using POST to create data with JSON:API
  • Using PATCH to update data with JSON:API
  • Using DELETE to remove data with JSON:API
  • Using Views to provide custom data sources
  • Using OAuth methods

The Serialization module provides a means of serializing data to or deserializing from formats such as JSON and XML. The RESTful Web Services module ...

Get Drupal 10 Development Cookbook - Third Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.