RESTful module - Best practices

The RESTful module achieves a practical RESTful for Drupal following best practices.

Further documentation and examples can be found at the RESTful module wiki.

Concept

The following also describes the difference between other modules such as RestWs and Services Entity.

Comparison of Web-service client modules

There are several modules in Drupal that act as Web-service clients. Ideally, we'd only have one, but this page attempts to point them out and highlight some differences. At some point, perhaps for Drupal 8, we'll be able to merge all of these.

Services Security Updates

This page is used as documentation for Services Security. It is unfortunate that issues come up that affect Services, but running the latest version of Services should help mitigate any issues.

If you see an issue and think it is security related, please follow the instructions here

OAuth authentication (Drupal 8)

Below are the steps to configure OAuth so it can authenticate requests in Drupal 8.

Requirements

Read installation instructions on PECL's OAuth extension.

The easiest way to install this extension is through PEAR using the following command:

pear install HTTP_OAuth

Installation

Download and install OAuth module from the project page.

If you see an error during installation regarding PECL's OAuth extension, please read the installation instructions in the Requirements section.

Set up

Follow these steps to configure OAuth Authentication for requests:

1. Set OAuth authentication for a REST resource.
2. Adust permissions.
3. Obtain a pair of OAuth consumer and secret keys.
4. Test the resource.

Set OAuth authentication for a REST resource

Bash script example for custom services action with session authentication

Here is Bash script example how to work with custom services action that requires session authentication.

Endpoint requirements :

Services Content Lock Documentation

Description

services_content_lock adds Services support to the community module called content_lock that will prevent two users from editing the same node concurrently. This module exposes the main operations of content_lock through Services as a resource, so that content locking can be done over a web service API such as REST. The main operations it currently implements are retrieve, create, and delete. This page will document how to use the operations in this resource.

Operations

The operations this resource implements for content_lock are:

  • retrieve - Find out if a node is locked and get info about a lock e.g. who owns the lock and when it was created.
  • create - Create a new content lock on a node. Locks a node preventing other users from editing it.
  • delete - Deletes an existing lock on a node. Only the lock owner may delete the lock.

Below each operation is documented in detail, including example CURL commands.

Retrieve

Definition

Pages

Subscribe with RSS Subscribe to RSS - rest