It creates a JSON:API Resource for each Views display, allowing for easy consumption of that data outside of Drupal.
For a full description of the module, visit the project page.
Submit bug reports and feature suggestions, or track changes in the issue queue.
- Requirements
- Installation
- Features
- Maintainers
- Drupal 10 or 11
- Views (Drupal core)
- JSON:API Resources
-
Download and install via Composer:
composer require drupal/jsonapi_views
-
Enable the module:
drush en jsonapi_views
When installed, the module activates a JSON:API resource for every enabled View display. The resource can be disabled per-display by editing the view and unchecking "Expose via JSON:API" in the display's JSON:API settings.
The URL of the JSON:API Views resource is shown while editing a view, based on the view's current preview state (filters, pagination and sorts included).
- JSON:API resource per View display:
/jsonapi/views/{{ viewId }}/{{ displayId }} - Pagination:
?page=# - Exposed filters:
?views-filter[{{ filter }}]={{ value }} - Contextual filters:
?views-argument[]={{ value }}- Multiple arguments as such:
?views-argument[]={{ value }}&views-argument[]={{ value2 }}
- Multiple arguments as such:
- Exposed sorts:
?views-sort[sort_by]={{ sortId }}
- Stuart Clark - deciphered
- John Ferris - pixelwhip