2

Getting a node via Drupal 8's RESTful web service can be done by doing a GET with this url:

/entity/node/1

How then, do you access a View? I've tried the following, with no luck:

entity/view/myviewid

Where 'myviewid' is id specified in views.view.myview.yml

My rest settings for views are exacty the same for nodes, which return JSON successfully. The view GET attempt however, returns a 500 Internal Server Error.

1 Answer 1

5

If you have the rest module enabled you have a new display type called "REST export". There you can configure to either return just the normal REST output for all entities, or you can even configure which fields you want to include.

Much like you enable REST support for entity types you also don't want to deal with unwanted REST access by default.

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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