-
Notifications
You must be signed in to change notification settings - Fork 173
Home
Jo Fitzgerald edited this page Jul 29, 2019
·
87 revisions
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.
- Consuming your API e.g. from a Javascript framework
- Documenting your API
- Using the API from within Drupal
Defining your own RESTful resource plugin.
- Defining a resource plugin (1.x)
- Defining a resource plugin (2.x)
- Resource plugin definition properties (for 2.x)
- defining the public fields (2.x) — also see 1.x
- Using process callbacks to modify field data
-
specifying available HTTP methods for each field (was
create_or_update_passthrough
in 1.x)
Relationships:
Going deeper:
- about a resource's OPTIONS request
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 available "out of the box".
- assigning a different data provider for your resource
- creating a custom data provider
Example custom data providers:
- access data from a secondary database
- creating a URL alias lookup with DataProviderDbQuery
- access published and unpublished nodes
- about RESTful's response formatters
- Authenticating with Drupal via REST
Read Upgrading from 1.x to 2.x.
- 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
- usage with Backbone.js
- usage with EmberJS (3-part series)
- 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.
- Using a different field for URL ID
- Creating a resource that takes data from a secondary database
See the FAQ section.
Check through this list to see if you've forgotten anything.