REST API for pages

Hey there,

I know this question has been asked before and the asnwers are very different and confusing when looking into the archive, depending on when it was asked/answered. That is why I’m asking it again.

I would love to be able to have GET/POST(/PUT) access to pages using JSON.

There are some plugins on github that have not been updated for at least a year and mostly do not have docs. (Some of them don’t even have a lot of code…)

I don’t want to complain, I would love to hear from people that have been able to achieve something like this (fully or partially) or that can tell me how to get started building a simple plugin that does just that.

My main use case is “in page editing” like in a wiki. So if there are any ideas flying around related to that they re also welcome.

I’m open for PM’s on slack as well (@karfau).

Hope this becomes an updated pool of helpful information.

Last I used it, somewhere around v1.3.x of Grav, the API-plugin worked as expected for pages. You don’t actually need much code for a REST API, just a receiver and ideally authentication.

The prospect of a fully-fledged API has been discussed, especially the possibility of a GraphQL-implementation. This, however, requires major work to integrate well with core - and as such it is at best in the pipeline for Grav v2.

1 Like

GraphQL integration would be so nice for modern frontend developer using Vue.js or React.js!

I hope Grav Team still consider it!

It is one of the most wanted feature IMO.

Last commit 3 years ago, does it’s still working?

Man, this is now asked almost weekly and every thread has useful new info. I’ve never seen the API plugin @OleVik mentions in response, for example.

I do think this should concept have a canonical home. My paralysis is “where?”. Github issue perhaps? Or maybe within the API plugin repo, which seems like it could use a new maintainer.