RESTful Web Services module

Exposes entities and other resources as RESTful web API.

RESTful Web Services module overview

The RESTful Web Services is a Drupal 8 core module. It exposes entities and other resources as RESTful web API.

1. Getting started: REST configuration & REST request fundamentals

1. Configuration

2. GET for reading content entities

Follow these steps to expose resources to GET requests:

3. POST for creating content entities

Follow these steps to expose resources to POST requests:

4. PATCH for updating content entities

Follow these steps to expose resources to PATCH requests:

OAuth patch example

Here is a practical example on how to update a node.

5. DELETE for deleting content entities

Follow these steps to expose resources to DELETE requests:

GET on Views-generated lists

The REST export display plugin uses the Serializer to output lists of entities in different formats (JSON, XML, ...).

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.

More info and resources for Drupal 8.x REST API

REST architecture basics

Using other authentication protocols

In the previous examples, we have used HTTP Basic authentication for all requests. You can also use other authentication protocols.

Guide maintainers