Fork me on GitHub

In this example, we'll create a REST export to return recent article node JSON data:

  "title":[{"value":"Hello World"}]
   "title":[{"value":"Goodbye World"}]

Build the REST export View

In Drupal, go to admin/structure/views/add, then on the Add new view form, enter values like this:

  • View name: My Articles
  • Show Content of type Article sorted by Newest first
  • Check the Provide a REST export checkbox
  • REST export path: my-articles

Then click the Save & edit button.

Preview View Results as JSON

Now when we preview the results of our view, we should see something like the JSON listed above.

Save the View

Our view is ready to go!