Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Clone this wiki locally
Welcome to the RESTful wiki!
RESTful v2.x is the current recommended version. The 1.x documentation has been retained for those still using that version, and to help those upgrading to 2.x to see what has changed.
- [Tutorials & blog posts (2.x)](Tutorials & blog posts)
- [Tutorials & blog posts (1.x)](Tutorials & blog posts (1.x))
The RESTful api: overview
- Documenting your API
- Using the API from within Drupal
Defining your own RESTful resource plugin.
- [Defining a resource plugin (1.x)](1.1. Defining a resource plugin (1.x))
- [Defining a resource plugin (2.x)](1.2. Defining a resource plugin (2.x))
- Resource plugin definition properties (for 2.x)
Filtering, sorting and pagination
- defining the public fields (2.x) — also see 1.x
- Using process callbacks to modify field data
- [specifying available HTTP methods](Specifying available HTTP methods for each field) for each field (was
OPTIONS and Resource discovery
- about a resource's [OPTIONS request](OPTIONS requests)
RESTful 2.x comes with numerous "data provider" classes. The data provider class abstracts the data access functionality from the resource class.
- [List of data providers](7.2. List of data providers (2x)) available "out of the box".
- [assigning a different data provider](7.3. Assigning a different data provider) for your resource
- [creating a custom data provider](7.4. Creating a custom data provider)
Example custom data providers:
- [access data from a secondary database](access data from a secondary database)
- creating a URL alias lookup with DataProviderDbQuery
- [access published and unpublished nodes](9.1. Access-unpublished-nodes)
- about RESTful's [response formatters](About response formatters)
- Authenticating with Drupal via REST
How to upgrade to RESTful 2.x
Common scenarios & recipes
- supporting client-side auto-complete
- requesting the current user information (also 1.x version)
- registering a new user
- filtering users by role
- saving an entity back to Drupal
- using Drupal core's block visibility to return entities visible at a specified path
- Filter on taxonomy term name, instead of term ID
- custom field access control
- working with "old-school" modules that directly add data to an entity (e.g. in node_load)? Read what do to [when a property isn't available](When a property isn't available).
- Using a different field for URL ID
- Creating a resource that takes data from a secondary database
Frequently asked questions
See the FAQ section.
When things go wrong
Check through this list to see if you've forgotten anything.