Skip to content
Snippets Groups Projects
Select Git revision
  • 7.x-1.2
  • 7.x-1.x default
  • 2900460-remove_views_resource
  • 6.x-1.x
  • 7.x-1.4
  • 7.x-1.3
  • 7.x-1.3-rc1
  • 7.x-1.2-beta1
  • 7.x-1.1
  • 7.x-1.0
  • 7.x-1.0-beta2
  • 7.x-1.0-beta1
12 results

services_views

  • Open with
  • Download source code
  • Allan Chappell's avatar
    Merge commit 'efda8237' into 7.x-1.x
    Allan Chappell authored
    18d718e1
    History
    Views support for the Services module version 3.x and later.
    
    It has currently two features:
    - Execute any view of the system via views resource call
    - Create view based resource creating Services display in a view
    
    Executing view via views resource
    After enabling "views" resource in your services endpoint you can do
    GET request to:
    
    http://example.com/<endpoint path>/views/<view name>
    
    This will execute a view and pass results.
    
    Possible arguments:
    - display_id: views display
    - args: array of view arguments
    - filters: array of view filter values
    - offset: views offset
    - limit: limit views number of results
    - format_output: boolean whether we would like to get themed view or data
    
    Example of calls:
    
    http://example.com/rest/views/articles?limit=5&offset=2&filters[tags]=5
    http://example.com/rest/views/articles?filters[tags]=5&display_id=block_1&format_output=1
    
    Create view based resource creating Services display in a view
    In any view you can create "Services" display. It has only one option setting
    -- path. That will be the name of your resource. After enabling that resource
    you would be able to do call to
    
    http://example.com/<endpoint path>/<resource name>
    
    This will execute a view and output results. You can create exposed filters and
    pass them to your resource. For example if we created exposed filter "tags" call
    will be:
    
    http://example.com/<endpoint path>/<resource name>?tags=7