Collections (filtering, sorting, and paginating)

When requesting a collection you'll eventually want to filter or sort the output as well as adding some pagination. This is possible pretty much out of the box by the jsonapi module. On this page we'll provide some examples on the filtering syntax and how to use the sorting and pagination in your projects.

Core Concepts

JSON API has many concepts in the specification, not all of which are documented here. However, users of the module do not need to completely understand all of the concepts of the specification to become productive with this module. If you would like to go deeper into how JSON API's documents are structured, why the module does something in one way or another, or just would like to learn more about the module's design, readers are encouraged to read the specification on

Contributed Modules

This is a space for contributed modules related to RESTful web services to put their documentation.

Serialization module: (de)serializing data to/from JSON & more

The Serialization module is included in Drupal 8 core.

It is built on top of the Symfony Serializer component.

The Serialization module provides a framework to add additional serialization formats simply by installing additional modules. Drupal 8 core's HAL module adds support for HAL+JSON, the CSV serialization contrib module adds CSV support.

JavaScript and Drupal 8 RESTful Web Services

This page aims to outline how to use JavaScript to communicate with Drupal 8's RESTful services. It is broken into sections per entity type.

It outlines:

  1. which HTTP method to use (GET, POST, PATCH, or DELETE) on which URL
  2. which headers to send
  3. what response can be expected from the server

For the following entity types:

HAL module: serialization using the Hypertext Application Language

The HAL module is included in Drupal core. When enabled, the HAL module serializes entities using HAL (Hypertext Application Language).

What is it?

For general information about the language, see the informal or formal (06) HAL specification.


Subscribe with RSS Subscribe to RSS - json