0

I can see Drupal 8 Views support REST Export.

But not JSON API.

So how to integrate Views with JSON API?

https://www.drupal.org/project/jsonapi

  • 4
    You can't. JSON API gives you the same (and more) power to achieve similar results as if using REST+Views. See this comparison – theuni Jul 25 '18 at 5:48
  • Is there any alternatives so I can get views in JSON. Last will be custom – Julia Jul 25 '18 at 6:04
1

Just enable RESTful Web Services and provide REST export in your view.

enter image description here

  • 1
    That's core's REST + view. That's not what's asked for. – theuni Jul 25 '18 at 9:24
1

If you want to display the structure of the view as JSON API output you need to get the UUID of the view and then pass it to the json api For example as given below.

http://yoursite/jsonapi/view/view/889120bb-98f2-43be-8ca3-d93d1cd15590

To get the UUID of the view you need to go http://yoursite/jsonapi and scroll to the View portion of the output and then go to the links block. That will list all the views in the site with their UUIDs.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for?Browse other questions tagged or ask your own question.