Exposes Drupal resources (e.g. entities) as RESTful web services.

The module makes use of the Entity API and the information about entity properties (provided via hook_entity_property_info()) to provide resource representations for all entity types (nodes, comments, users, taxonomy terms, ..). It aims to be fully compliant to the REST principles.

Developers can also implement custom resources that can be exposed via the same interface (example in restws.api.php). See the README.txt for further design goals and checkout the documentation page.

#D8CX: I pledge that RESTWS will be obsolete on the day that Drupal 8 is released, because we have REST module in D8 core now!

Features and differences to the Services module:

  • Provides only RESTful services (no message-oriented or RPC-style web services like SOAP, XML-RPC etc.).
  • Builds upon the Entity API, to provide support for all entity types out of the box.
  • Supports CRUD (create, read, update, delete) operations on all entities.
  • There are no "service endpoints" to configure as resources are just available at uniform paths like "node/1", "user/1". For that the HTTP Accept headers are respected, so if the client requests JSON instead of HTML, it will get it.
  • Querying support to retrieve lists of entities, can also be filtered with GET parameters.
  • Currently JSON, XML and RDF/XML are available as resource representation formats, while modules can add more. The RDF format makes use of the RDF mapping core provides, and is read-only.

Which version should I use?

The 7.x-1.x branch is now frozen and will get security fixes only. The 7.x-2.x branch has introduced an important API change regarding the semantics of PUT/POST requests (see #1472634: HTTP PUT / POST Reversed for CRUD CREATE / UPDATE Operations) and adds a lot of querying features. If you want to start a new project with RESTWS use the latest 2.x release. If you are running 1.x versions of RESTWS do not upgrade to 2.x without prior testing/adoption of your clients.

Warning: SA-CONTRIB-2016-040

Versions prior to 7.x-2.6 and 7.x-1.7 are affected by a highly critical security vulnerability. Upgrade to the latest version!

Credits

Supporting organizations: 
Maintenance
Initial development and maintenance

Project information

  • caution Seeking co-maintainer(s)
    Maintainers are looking for help reviewing issues.
  • caution Maintenance fixes only
    Considered feature-complete by its maintainers.
  • chart icon1,726 sites report using this module
  • Created by klausi on , updated
  • shieldStable releases for this project are covered by the security advisory policy.
    Look for the shield icon below.

Releases